Skip to content

NunuM/talos-bus-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version

RabbitMQ client using amqplib

Features

  • 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

Install

npm install talos-bus

Example

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')));

About

RabbitMQ client for NodeJS written in Typescript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published