RabbitMQ Messaging Polyglot by Luis Majano lmajano@ortussolutions.com
This project was originally forked from Rob Harrop https://github.com/robharrop/presentations
In order to execute the examples you will need to have RabbitMQ Server installed: http://www.rabbitmq.com/
For the STOMP example you will need to install the web-stomp plugin for RabbitMQ: http://www.rabbitmq.com/web-stomp.html
Invoke the sbin/rabbitmq-server
shell script.
You can also start the server in detached mode with rabbitmq-server -detached
, in which case the server process runs in the background.
You can customise the RabbitMQ environment by setting environment variables in $RABBITMQ_HOME/etc/rabbitmq/rabbitmq-env.conf
. Server components may be configured, too, in the RabbitMQ configuration file located at $RABBITMQ_HOME/etc/rabbitmq/rabbitmq.config
. Neither of these files exist after installation.
The broker creates a user guest
with password guest
. Unconfigured clients will in general use these credentials. By default, these credentials can only be used when connecting to the broker as localhost
so you will need to take action before connecting fromn any other machine.
Install the managment plugin first
rabbitmq-plugins enable rabbitmq_management
More information at: https://www.rabbitmq.com/management.html
http://localhost:15672/
guest:guest
Install the plugin:
rabbitmq-plugins enable rabbitmq_web_stomp
More information at: http://www.rabbitmq.com/web-stomp.html
The source code is divided into consumers and producers.
- Java
- ColdFusion
- ColdFusion : Running a consumer via CFML asynchronously
- Groovy : Running via Groovy
- Java : Running via two Java consumers
- Node : Running using SockJS and node
- Stomp JS : Running via only SockJS and communicating to RabbitMQ via STOMP
Default Exchange is the ''
empty exchange, which is a direct exchange or
you can use the amq.direct exchange as well.
The routing key used is stock.prices
and since it is a direct exchange
the queue name is also stock.prices
http://127.0.0.1:15674/stomp
Valid destination types are: /temp-queue, /exchange, /topic, /queue, /amq/queue, /reply-queue/
.
Use /queue
for durable queues
Use /amq/queque
for default exchange and non-durable queues