How to user the package?
Create a simple Publisher
import { Brokers } from '@ifextech/message-broker-wrappers';
const nats = new Brokers.Nats()
nats.connect({ host: /* Your host here */ })
.then(() => {
nats.publish('to', { payload: {} }, () => /* Your logic here */)
})
Create a simple Subscriber
import { Brokers } from '@ifextech/message-broker-wrappers';
const nats = new Brokers.Nats()
nats.connect({ host: /* Your host here */ })
.then(() => {
nats.subscribe('to', () => /* Your logic here */)
})