@skycatch-api/skyport-messaging
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

skyport-messaging

Nodejs lib to encapsuate messaging to many queue brokers (as of now, just RabbitMQ)

Produce message

const MessagingClient = require('skyport-messaging')('RabbitMQ');
const client = new MessagingClient();

await client.connect({
  url: process.env.BROKER_URL,
  connectionName: 'my_connection'
})

await client.produce('myQueueName', { myMessage: 'Hello' })

Consume messages

const MessagingClient = require('skyport-messaging')('RabbitMQ');
const client = new MessagingClient();

await client.connect({
  url: process.env.BROKER_URL,
  connectionName: 'my_connection'
})

await client.consume('myQueueName', (message) => {
  ///do something with the message
})

Readme

Keywords

none

Package Sidebar

Install

npm i @skycatch-api/skyport-messaging

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

21.8 kB

Total Files

12

Last publish

Collaborators

  • aldoromo88
  • manuel_rdza_sky
  • csanz