This library is meant to be used with RabbitMQ 4.0.
Suitable for testing in pre-production environments. The public API(s) could change.
The client is distributed via npm:
npm install rabbitmq-amqp-js-clientNOTE: This is just a first example and will be replaced with a reference to the examples folder
The following example demonstrates how to create an environment, open a connection, and use the management to create and delete queues, exchanges, and bindings.
const environment = createEnvironment({ host: "localhost", port: 5672, username: "rabbit", password: "rabbit", }) const connection = await environment.createConnection() const management = connection.management() const queue = await management.declareQueue("test") const exchange = await management.declareExchange("exchange", { type: "topic" }) const secondExchange = await management.declareExchange("exchange-dest", { type: "topic" }) const bindingToQueue = await management.bind("foo", { source: exchange, destination: queue }) const bindingToExchange = await management.bind("foo", { source: exchange, destination: secondExchange }) await management.unbind("foo", { source: exchange, destination: queue }) await management.unbind("foo", { source: exchange, destination: secondExchange }) await management.deleteExchange("exchange") await management.deleteExchange("exchange-dest") await management.deleteQueue("test") management.close() await connection.close() await environment.close()- Reference library for AMQP 1.0
- AMQP 1.0 documentation
- AMQP 1.0 over WebSocket (blog post)
- .Net client (reference implementation)
The interface shall be uniformed to all other clients in order to have unified documentation. While developing, keep in mind the support for autoreconnect.
-
Implement the management functions via AMQP
- "REST style" send message
- handling
senderLink,receiverLink - generating exchanges, queues, bindings
-
Implementing connections
-
Implementing environment
-
Provide simple APIs for publishing and consuming
-
(OPTIONAL) Autoreconnect (possibly already managed by RHEA)
-
(OPTIONAL) Metrics for Prometheus