Hemera-rabbitmq
This is a plugin to use RabbitMQ with Hemera.
RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received. It is complementary to the primary NATS transport system.
The client use JSON to transfer data.
Start RabbitMQ instance
Start a rabbitmq instance via docker-compose
docker-compose up
Administration
Visit http://127.0.0.1:15672 and log in with
Username: user
Password: user
Example
const Hemera = const nats = const hemera = nats logLevel: 'info'hemera// Topology & configuration via JSON look at https://github.com/arobson/rabbothemera
Plugin dependencies
- hemera-joi
Interface
publish
The pattern is:
topic
: is the service name to publish torabbitmq
cmd
: is the command to executepublish
exchange
: the name of the exachangestring
options
: rabbot transport optionsobject
data
: the data to transferobject
Example:
hemera
request
The pattern is:
topic
: is the service name to publish torabbitmq
cmd
: is the command to executepublish
exchange
: the name of the exachangestring
options
: rabbot transport optionsobject
data
: the data to transferobject
Example:
hemera
Create pub/sub subscriber
Create a new rabbitmq subscriber which handles the interest on this subject and forward all message with pub/sub semantic to the hemera service.
The interface is:
pattern
: the pattern which arrive hemeratype
: the typestring
Example:
hemerarabbitmq
Create request/reply subscriber
Create a new rabbitmq subscriber which handles the interest on this subject and forward all message with request/reply semantic to the hemera service.
The interface is:
pattern
: the pattern which arrive hemeratype
: the typestring
Example:
hemerarabbitmq
Consume events
The pattern is:
topic
: is a combination of the serviec name and the typerabbitmq.<type>
Example:
hemera