On 06/11/2014 03:51 AM, spam trap wrote:
On Tue, 10 Jun 2014 11:07:43 -0400, Timothy Bish
<tabish...@gmail.com> wrote:

On 06/10/2014 06:47 AM, spam trap wrote:
On Tue, 10 Jun 2014 06:06:03 -0400, Timothy Bish
<tabish...@gmail.com> wrote:

On 06/10/2014 04:42 AM, spam trap wrote:
[ActiveMQ-CPP 3.8.2]

I am unsure how to configure the failover transport correctly.  We
have maxReconnectAttempts & startupMaxReconnectAttempts set to the
default which should mean the transport should retry to connect
forever, yes?  However, if the broker is not available, the connection
attempt gives up after 20 seconds (which is the setting of "timeout"
which I believe is only for sending data, yes?)

(The other connection options we are using are:
useExponentialBackOff=false
initialReconnectDelay=5000
timeout=20000)

Can anyone clarify this?


Please provide the complete connection URI so we can see what you are
starting from.
Here's an example:

failover://(tcp://localhost:61617)?useExponentialBackOff=false&initialReconnectDelay=5000&timeout=20000


Tested locally and it works as expected, client sits and waits for a
broker indefinitely.  Recommend some additional debug on your side to
see what's happening.
Here's the exception message & trace:

"Failover timeout of 20000 ms reached."
FILE: activemq/core/ActiveMQConnection.cpp, LINE: 1285
FILE: activemq/core/ActiveMQConnection.cpp, LINE: 1363
FILE: activemq/core/ActiveMQConnection.cpp, LINE: 656

It throws the exception at the highlighted line (some code omitted for
brevity):

pConnectionFactory =
cms::ConnectionFactory::createCMSConnectionFactory(
              brokerURI);
pConnection = m_pConnectionFactory->createConnection();
pConnection->setClientID(m_name);  <<-- here

"m_name" is unique.


This is currently working as designed. The Failover transport doesn't do much checking for the type of thing being sent when timeout is set so the call to start or setClientID will trigger a ConnectionInfo object to be sent to the broker and since there is no connection the operation will timeout. This is why the failover timeout option is not something I'd really advise you use unless you can prove that it's entirely necessary.

--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply via email to