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.
As this connector tries to be as generic as possible it is hard to support all the advanced features of MCollective using it. We do not recommend you use the directed mode using this plugin, instead look towards specific ones written for ActiveMQ or your chosen middleware.
For broadcast messages this connector will create topics with names like /topic/<collective>.<agent>.command and replies will go to /topic/<collective>.<agent>.reply
For directed messages it will create queues with names like /queue/<collective>.mcollective.<md5 hash of identity>.
You should configure appropriate ACLs on your middleware to allow this scheme
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.
If you are using version 1.1.9 and newer of the Stomp Gem and this method of configuration you will also receive more detailed logging about connections, failures and other significant events.
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: