Open mailmeankit opened 6 years ago
Is there any error? Or it just never emits connection_open? You can get more information by setting env var DEBUG=rhea*.
It never emits connection_open and I am still trying to debug this but still no success.
Do I need to add any more configurations or I am missing something to connect to AWS MQ via rhea module?
DEBUG=rhea* will enable debug logging. I assume AMQP 1.0 is enabled for your AWS MQ instance?
I just completed the same exercise and got it working. If you attach on('connection_error', ...) to the connection (I attached it to the connection and container to be safe) you should get some more meaningful error messages.
@erothmayer Sorry I didn't get it, can you please provide a code example to me or edit the above code for me, will be really helpful for me. I also tried with on('connection_error', ...) but still no success.
Thanks
Hi,
Thanks for the details and yes I am able to connect to AWS MQ using rhea module.
Now, I am have come to another issue for my prod deployment, as I need to establish the connection with failover string as the deployment mode is active/standby. Below is the failover connection string format:
failover:(amqps://'your-host-name1':'port',amqps://'your-host-name2':'port')
I didn't find any method to implement the same using rhea module.
Can anyone please help me with this ?
Thanks
Have a look at the reconnect example: https://github.com/amqp/rhea/blob/master/examples/reconnect/client.js#L38
You can specify a function to return the connection details and have this iterate over a list of host/port combinations.
thanks, it's working, one more query I have is how to find the state of queue means is queue empty or how many messages exist in the queue?
You would need to use some management api for the broker for that. If it supports management queries over amqp messages, you will need to get the broker specific schema for that.
Ok I will look for that, but is there any way in rhea module through which I can get an iterator for messages, something like which tells is hasNext() exists or not?
You can drain the credit, which tells you that either the broker sent you as many messages as you gave it credit for or had no further messages to give. See https://github.com/amqp/rhea/blob/master/examples/drain.js for a simple example of that.
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
If tls is the issue, you can try rejectUnauthorised=true in the connect options. If it works with that, then it is likely an issue with the certificate/ca. If not, check the port in use.
I'm facing the same issue, could you pls share source code and steps whichever you have followed. Much appreciated for your help.
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.
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.
Can you please help me on this that what I am doing wrong, I am using rhea npm module in Nodejs?
Thanks