question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Amazon MQ Active/Standby Issue

See original GitHub issue

I am using this library to connect to Amazon MQ Single Broker and it works as expected.

When I am trying to connect to an Active/Standby broker I get protocol_error. I used the reconnect example.

  rhea:reconnect [d1063682-cb50-40fb-b561-47c5e423a8e6] reconnecting... +0ms
  rhea:io [62e8999d-281f-4935-9ce5-fe94863a3a34] connected x.x.x.x:59259 -> x.x.x.x:5671 +501ms
  rhea:frames [62e8999d-281f-4935-9ce5-fe94863a3a34] -> { protocol_id: 3, major: 1, minor: 0, revision: 0 } +595ms
  rhea:io [62e8999d-281f-4935-9ce5-fe94863a3a34] read 7 bytes +261ms
  rhea:events [62e8999d-281f-4935-9ce5-fe94863a3a34] Connection got event: protocol_error +561ms
  rhea-promise:connection [62e8999d-281f-4935-9ce5-fe94863a3a34] connection got event: 'protocol_error'. Re-emitting the translated context. +560ms
  rhea-promise:translate [] Translating the context for event: 'protocol_error'. +561ms

I can also see this using connection.on to capture protocol errors

{ [ProtocolError: Invalid protocol header for AMQP ]
  message: 'Invalid protocol header for AMQP \u0015\u0003\u0003\u0000',
  name: 'ProtocolError' }

connectionOption:

    this.connectionOptions = {
      connection_details: () => {
        const parsedUri = URI.parse(activeMQURIS[this.attempt % activeMQURIS.length]);
        // @ts-ignore
        const detail: ConnectionDetails = {
          host: `${parsedUri.host}`,
          port: Number(parsedUri.port).valueOf(),
        };
        this.attempt++;
        return detail;
      },
      container_id: uuid.v4(),
      id: uuid.v4(),
      password: activeMQPassword,
      reconnect: true,
      transport: "tls",
      username: activeMQUser,
    };

Can’t figure out how to solve this. Your help will be much appreciated.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
robtayl0rcommented, Jun 25, 2019

For any other Amazon MQ users hitting this page (and maintainers of rhea), while I ran into the same result initially, adding transport:"tls" to my connection options did the trick. (I also realized this had nothing to do with their ActiveMQ broker, just my lack of tls configuration. )

0reactions
isikhicommented, Sep 18, 2019
rhea.connect ({
        connection_details: () => ({
          host: failOverHost,
          port: mq.port,
          transport: mq.transport,
        }),
        username: mq.username,
        password: mq.password,
      });
...

I implemented this way. I think that will solve

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon MQ active/standby broker for high availability
An active/standby broker is comprised of two brokers in two different Availability Zones, configured in a redundant pair . These brokers communicate ...
Read more >
Amazon MQ active/standby broker for high availability
If one of the broker instances malfunctions or undergoes maintenance, it takes Amazon MQ a short while to take the inactive instance out...
Read more >
Cause a broker failover - AmazonMQ Workshop For ActiveMQ
You have successfully seen how the Amazon MQ Active-Standby model works, where rebooting the Active broker caused a very small glitch and then...
Read more >
AmazonMQ active/standby mode failover time - Stack Overflow
Amazon mq active/standby mode does requires a promotion time to switch standby broker to active mode. Need to use Network of brokers in ......
Read more >
AWS MQ Best Practices - Trend Micro
Ensure that your Amazon MQ brokers are using the active/standby deployment mode. MQ Desired Broker Instance Type. Ensure that all your Amazon MQ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found