On 07/19/2018 07:02 PM, developer wrote:
Hi,
This question is with reference to activemq cpp version 3.9.3
Once we call intialize and establish connection by calling
activemq::library::ActiveMQCPP::initializeLibrary();
x= ActiveMQConnectionFactory() ;
connection = x->createConnection(xy,xz);
connection->start();
and communication starts ..
due to some reason if the connection to broker is lost, (like disconnected
physical connection or broker stopped)
what is the best way to reestablish communication in this case?
Use the failover URI to have the client handle reconnects for you.
what is the correct sequence...
If i call
connection->close();
Be sure to delete the connection as well
and then reestablish everything via
activemq::library::ActiveMQCPP::initializeLibrary();
Don't call initialize more than once unless you've also shutdown the
library in between
x= ActiveMQConnectionFactory() ;
connection = x->createConnection(xy,xz);
connection->start();
communication is back but this is creating some additional threads in qnx
environment.
calling just
connection->close();
connection->start();
doesn't reestablish the connection.
--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/