activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Do activemq-cpp connection questions.
Date Tue, 29 Nov 2011 16:32:19 GMT
On Tue, 2011-11-29 at 08:22 -0800, JRR wrote:
> Hello,
> 
> I've read through the activemq-cpp tutorial at
> http://activemq.apache.org/cms/cms-api-overview.html and I've poked around
> the forums.
> 
> Do activemq-cpp connection have a timeout when the client is connecting to
> the broker? I ask because reading this post
> (http://activemq.2283324.n4.nabble.com/Async-Exception-multiple-threads-one-connection-tp2351214p2351217.html)
> comments on a connection being disconnected due to inactivity. Although that
> articles example is Java based as opposed to C++. I've looked through the
> connections class and I do not see anything relating to a connection
> timeout. Do activemqq-cpp connections have a timeout?
> 
> Aside from that what is the process or detecting if a connection is down and
> then reestablishing the connection. For example, suppose the broker is
> restarted, but the producer is not. How would the producer know if its
> connection went down? Is it just that the MessageProducer's send throws an
> exception?
> 
> In order to reestablish the connection is it a matter of reallocating
> everything, connection, session, message producer, etc?
> 
> Are there other tutorials, web sites, etc. that you could refer me to for
> more information on activemq-cpp usage? Perhaps these questions are covered
> there?
> 
> Thank your time,
> 

If you use the failover transport then you don't have to deal with the
problem of reestablishing the connection, the client will do that for
you.  If you don't use that then you need to catch exceptions from the
client calls as well as register an onException handler to know that the
client connection has failed and then tear down and rebuild the CMS
objects.  

You can view the various configuration options for the transports and
client here:
http://activemq.apache.org/cms/configuring.html

Regards

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/




Mime
View raw message