The stomp connector uses the STOMP rubygem to connect to compatible servers. This is known to work with ActiveMQ and Stompserver. Anecdotal evidence suggests it works with RabbitMQ’s Stomp plugin.
This code will only work with version 1.1 and 1.1.6 or newer of the Stomp gem, the in between versions have threading issues.
The most basic configuration method is supported in all versions of the gem:
You can override all of these settings using environment variables STOMP_SERVER, STOMP_PORT, STOMP_USER, STOMP_PASSWORD. It is recommended that your client.cfg do not have usernames and passwords in it, users should set their own in the environment.
If you are seeing issues with the Stomp gem logging protocol errors and resetting your connections, especially if you are using Ruby on Rails then set the plugin.stomp.base64 to true, this adds an additional layer of encoding on packets to make sure they don’t interfere with UTF8 encoding used in Rails.
Newer versions of the Stomp gem supports failover between multiple Stomp servers, you need at least 1.1.6 to use this.
This gives it 2 servers to attempt to connect to, if the first one fails it will use the second. As before usernames and passwords can be set with STOMP_USER, STOMP_PASSWORD.
If you do not specify a port it will default to 6163
When using pools you can also specify the following options, these are the defaults in the Stomp 1.1.6 gem:
As of version 5.4 of ActiveMQ messages support priorities, you can pass in the needed priority header by setting: