RabbitMQ client using amqplib
- Well-defined API
- Implemented Bus interface for RabbitMQ
- Automatic re-connection
- Message buffering between link failures
- Subscriptions are preserved between re-connections
- Injectable logger, let you use log4js for example
- Easy and intuitive to use
npm install talos-bus
const client = new RabbitMQ(new ClientConfig(
'amqp://guest:guest@localhost:5672'
));
const isConnected: boolean = await client.connect();
const subscription: Subscription = QueueSubscriptionBuilder.newBuilder("logs").isAutoDelete(true).build();
await client.subscribe(subscription);
subscription.on("message", console.log);
const sent: boolean = client.publish(Message.toQueue('logs', Buffer.from('message')));