Same examples from RabbitMQ, but tested with Apache qpid-j broker.
A set of little modified samples from RabbitMQ tutorial checked with Apache QPID-J broker.
First you need to install and run Apache Qpid-J broker either from site or from git repository. Then you need do some configuration tasks. Unfortunately amqp 0-9-1 does not support any of SASL auth mechainsms but PLAIN. By default PLAIN mechaism is not configured in Qpid-J. So you need to find "authenticationproviders" section and add
"secureOnlyMechanisms" : []
to all provider(s) you plan to use with AMQP protocol listener.
In fact I think this code will work with any MQ broker that support AMQP-0.9 (e.g. RabbitMQ) too.
To run the tutorial code first you need to install all neccessary libraries. Just type
npm install
and then you can run any scripts by typing (in bash)
./send.js
or (both in bash and windows console)
node ./send.js
A "Hello World" example, with one script sending a message to a queue, and another receiving messages from the same queue.
More sophisticated example. Multiple worker
process will share the
tasks among them. Mocking the long-time tasks executions.
Using MQ broker as a broadcast mechanism.
Using MQ broker as a router (somecast).
Extend previous tutorial to using wildcards.
Remote procedure call pattern with MQ broker
I slightly modified original RabbitMQ tutorial code.