Open Message Queue WebSocket Services


Back to Open MQ 5.0.1 Index Page

Enable Broker for 'wsjms' WebSocket Service
Enable Broker for 'wssjms' WebSocket Service
Broker WebSocket Configuration
Connect MQ JMS Client to Broker over WebSocket
Connect STOMP Client to Broker over WebSocket
Using Broker WebSocket Services with GlassFish Server

WebSocket is an HTML5 technology that provides bidirectional communication which starts via an HTTP request. Open MQ provides WebSocket support in two ways -- Java JMS over WebSocket and STOMP (1.2), and we include an experimental mapping via JSON. In addition, we provide support for both unencrypted and secure WebSocket connections.

This page provides setup details for using WebSocket in Open MQ.

Enable Broker for 'wsjms' WebSocket Service

The default 'ws' WebSocket service in a broker is named 'wsjms'. To enable the 'wsjms' service, add it to the following broker property setting
imq.service.activelist
By default it is set to following
imq.service.activelist=jms,admin
To add 'wsjms',
imq.service.activelist=jms,admin,wsjms

A broker 'ws' WebSocket service, by default, listens at port 7670 which is set by broker property
imq.wsjms.ws.port=7670

A broker WebSocket service can support 3 types of WebSocket clients

The type(s) of WebSocket clients that a broker can support is controlled by the broker property
imq.<websocket-service-name>.services

By default, the 'wsjms' and 'wssjms' (see next section) WebSocket services support all 3 types of clients,
imq.wsjms.services=mqjms,mqstomp,mqjsonstomp

Enable Broker for 'wss' WebSocket Service

Broker WebSocket Configuration

Please see mq/lib/props/broker/default.properties for a current list of broker properties that configures a WebSocket service. Some of them have been mentioned in above sections. The following broker property can also be set

imq.<websocket-service-name>.allowedOrigins - A list of comma separated origins (protocol scheme and hostname are checked) that are allowed to access the WebSocket service. When it is not set (default), all origins are allowed
imq.<wss-service-name>.wss.requireClientAuth - Set to true to require (default not) SSL client authentication for the 'wss' service

How to Connect a Java JMS Client to Broker over WebSocket (mqjms)

How to Connect a STOMP Client (mqstomp) to Broker over WebSocket

Here is a simple example of STOMP client in JavaScript.

How to Connect a JSON format STOMP Client (mqjsonstomp) to Broker over WebSocket

The JSON format described here is experimental.

Here is a simple example of JSON format STOMP client in JavaScript.

JSON Objects for JSON Format STOMP Client over WebSocket (mqjsonstomp)

Using Broker WebSocket Services with GlassFish Server

OpenMQ (GlassFish MQ) is the system JMS provider for GlassFish server. To use broker WebSocket services with GlassFish server, currently