You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by gali_ka <gk...@cisco.com> on 2008/03/11 15:38:38 UTC

connection initialization order

'm using activemq in my c++ application. In the examples published on the
active-mq site, I saw that connection->start() is called immediately after
creating connection. Is it necessary to call Connection::start() before
creating session, setting exception listener, creating consumer and
producer? Can I create and set all the connection members and call
connection->start() to be the last command in my connect process?
-- 
View this message in context: http://www.nabble.com/connection-initialization-order-tp15976647s2354p15976647.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: connection initialization order

Posted by ttmdev <jo...@ttmsolutions.com>.
It is not necessary to start your connection before setting it up (i.e.,
create sessions, listeners, etc.). As a matter fact, the JMS specification
recommends that you start your connection after you've completed your setup.
Here's the statement from the specification. 

"It is typical to leave the Connection in stopped mode until setup is
complete. At that point the Connection’s start() method is called and
messages begin arriving at the Connection’s consumers. This setup convention
minimizes any client confusion that may result from asynchronous message
delivery while the client is still in the process of setting itself up."

Joe
Goto www.ttmsolutions.com for a free ActiveMQ user guide
 

gali_ka wrote:
> 
> 'm using activemq in my c++ application. In the examples published on the
> active-mq site, I saw that connection->start() is called immediately after
> creating connection. Is it necessary to call Connection::start() before
> creating session, setting exception listener, creating consumer and
> producer? Can I create and set all the connection members and call
> connection->start() to be the last command in my connect process?
> 

-- 
View this message in context: http://www.nabble.com/connection-initialization-order-tp15976647s2354p15976669.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.