rhea: Unable to Connect to AWS MQ broker using rhea npm module ?

Hi, I am trying to connect to AWS MQ broker and consume and publish the message to AWS Active MQ.

But I am unable to connect to Broker and not even consume and publish the message to the broker. I have written the code below, please have a look.

  var client = require('rhea');

  const queueName = 'queueName';
  client.connect({
      transport: 'tls',
      host: 'host_name',
      hostname: 'host_name',
      username: 'userName',
      password: 'password',
      port: port,
      reconnect_limit: 10
  });
  console.log("client is to be", client);

  client.on('connection_open', (context) => {
      console.log("connected");
      var receiver = context.connection.open_receiver({
          source: {
              address: `${queueName}/$management`
          },
          autoaccept: false,
          target: {
              address: 'receiver-link'
          }
      });
      receiver.once('receiver_open', (context) => {
          console.log('receiver is now open....', context);
      });

      receiver.once('message', (context) => {
          console.log('message received by receiver....');
          console.log("message is", context.message);
      });
  });

Can you please help me on this that what I am doing wrong, I am using rhea npm module in Nodejs?

Thanks

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

I am also having problems connecting to AWS MQ using the rhea module. Can anyone who has been successful please share some source code and the steps they followed? Thank you.

I’m facing the same issue, could you pls share source code and steps whichever you have followed. Much appreciated for your help.

Hello mailmeankit.

We are striving connecting to an AWS MQ broker with the RHEA client, probably because of TLS as we got it working fine to a local ActiveMQ with TLS disabled.

Could you post the working code please ? (as the code posted initially doesn’t work I understand).

Thanks.

Guillaume