Used https://github.com/gdaws/node-stomp and https://github.com/postwait/node-amqp
Supported:
- AMQP and STOMP protocols
In config file:
mq: {
stomp: {
host: 'localhost',
port: 61613,
login: 'root',
password: '123456'
}
}or
mq: {
amqp: 'amqp://rsdrarqg:VjRIlEnXZkzNoFfjtx3U6mDTmFdKDkqG@crocodile.rmq.cloudamqp.com/rsdrarqg'
}In your module:
const service = new MqService('/queue/test');
service.subscribe((msg) => {
// receive messages for channel /queue/test
});
// push { message: 'test' } into channel /queue/test
service.push({
message: 'test'
});