Make sure you have enabled websockets transport before running this demo:

  1. Stop your ActvieMQ server
  2. open activemq.xml,
  3. find

    	
    <transportConnectors>
    	<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?wireFormat.maxInactivityDuration=0"/>
    </transportConnectors>
    	
    
  4. add <transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>. The result should look like

    	
    <transportConnectors>
    	<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?wireFormat.maxInactivityDuration=0"/>
    	<transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
    </transportConnectors>
    	
    
  5. save the file
  6. restart the ActiveMQ server.