ActiveMQCPP connection.start() hangs up

4k Views Asked by At

I'm using ActiveMQ CPP 5.2.3 if it matters.

I have JMS producer that connects using failover transport to JMS network of brokers. When I call connection->start() it hangs up (see AMQ-2114).

If I skip connection start() and call connection->createSession(), than this call is blocked too.

The requirement is that my application will try forever to connect to broker(s).

Any suggestions/workarounds?

NOTE:

This is not duplicate of here, since I'm talking about C++ and such solutions as embedded broker, spring are not available in C++.

1

There are 1 best solutions below

5
On BEST ANSWER

This is normal when the connection is awaiting a transport to connect to the broker. The start method must send the client's id info to the broker before any other operation, so if no connection is present it must block. You can set some options on the failover transport like the startupMaxReconnectAttempts option to control how long it will try to connect before reporting a failure. See the URI configuration page:

http://activemq.apache.org/cms/configuring.html