Does Fuse MQ support the use of websockets?

Solution Unverified - Updated -

Environment

  • Fuse MQ Enterprise 7.x
  • Fuse Message Broker 5.5.1.x

Issue

Does Fuse MQ support the use of websockets?

Resolution

Yes, Fuse Message Broker Supports WebSockets via the ws and wss (secure) transports.

Standard Configuration:

1) Configure the ws transport connector by editing (broker)/config/activemq.xml as follows:

<transportConnectors>
  <transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
</transportConnectors>

Secure Configuration:

1) Configure the wss transport connector by editing (broker)/config/activemq.xml as follows:

<transportConnectors>
  <transportConnector name="secure_websocket" uri="wss://0.0.0.0:61614"/>
</transportConnectors>

Note that we use wss url prefix to denote a secured version of the protocol.

2) Provide an SSL context for the wss transport. This is achieved by providing an sslContext in your broker configuration in a similar fashion to the configuration for the ssl and https transports.

<sslContext>
    <sslContext keyStore="file:${activemq.conf}/broker.ks"
                keyStorePassword="password" trustStore="file:${activemq.conf}/broker.ts"
                trustStorePassword="password"
    />
</sslContext>

That's it, your secure websocket transport is ready.

Demo:

An adapted demo of the stomp-websocket library is integrated with the Fuse Message Broker web demo application. Enable ws transport, start the broker and go to http://localhost:8161/demo/websocket to see it in action.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments