HTML and CSS Reference
In-Depth Information
First, open the file
ActiveMQ_HOME/conf/activemq.xml
and search for the string
transportConnectors
. Below the openwire transport connector, add the snippet shown
in Listing 5-3.
Listing 5-3.
Declaring the WebSocket Connector
<transportConnectors>
<transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
</transportConnectors>
Now, the transport connector section of your
activemq.xml
file should look similar
to Listing 5-4 (newly added section highlighted).
Listing 5-4.
activemq.xml Snippet with the WebSocket Connector
<!-- The transport connectors expose ActiveMQ over a given
protocol to clients and other brokers. For more
information, see:
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors>
<transportConnectors>
<transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
</transportConnectors>
Save the
activemq.xml
file and start ActiveMQ again, as shown in Listing 5-2.
Confirm that the WebSocket connector has been started, by looking for the line shown in
Listing 5-5 in the console.
Listing 5-5.
Log Message Indicating that the WebSocket Connector has been Started
INFO | Connector websocket Started
Now, you're ready to start the WebSocket example that ships as part of ActiveMQ. Navigate
Figure
5-5
shows the page that displays at this URL.