activemq-consumer
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

ActiveMQ Consumer

Installation

npm install activemq-consumer --save

Usage

// test.js
const { Consumer } = require('activemq-consumer');
// const constants = require('./secrets');

const constants = {
  username: 'username',
  password: 'password',
  brokerUrl: {
    wss: 'wss://mq-url:port',
  },
  queue: 'mq_test',
};

const app = new Consumer({
  stompConfing: {
    brokerURL: constants.brokerUrl.wss,
    connectHeaders: {
      login: constants.username,
      passcode: constants.password,
    },
    debug: function (str) {
      console.log(str);
    },
    reconnectDelay: 5000,
    heartbeatIncoming: 4000,
    heartbeatOutgoing: 4000,
  },
  destination: 'mq_test',
  // handleMessage is async function
  handleMessage: (message) => {
    console.log(message.body);
  },
});

app.start();

Readme

Keywords

Package Sidebar

Install

npm i activemq-consumer

Weekly Downloads

4

Version

1.0.3

License

Apache-2.0

Unpacked Size

41.4 kB

Total Files

31

Last publish

Collaborators

  • mahi424