No, it's probably the same cost. But the cost is in establishing the underlying connection, not in creating the session. It just happens that if you haven't started the connection by the time you try to create the session, creating the session will set up the underlying connection data structures before creating a session. Which would explain what you were seeing.
I would also be curious to understand why starting the connection before creating the session would get messages delivered. What version are you using? On Mon, May 13, 2013 at 4:57 PM, fenbers <[email protected]> wrote: > > > > > > > Well, what happens when you "create a connection" but > don't start it, it > > will open the transport and start wire format negotiation... when > you do > > connection.start().. or when you try to open a session, it will > ensure that > > the connection is properly constructed, which is the expensive > part. So > > sessions by themselves are cheap enough as long as the > connection > is up. > > > > I typically: > > create connection > create session > create producer/consumer > set producer/consumer options > start connection, which is the last thing before returning > from the run() method > > I find that if I start the connection right after Step 1, then I > occasionally see errors complaining that a message was received > before a consumer was created. Starting my connection last > seems > to resolve that problem. Are you saying that it is more > expensive > to do this in my order (above) than it would be if I started my > connection right after Step 1?? > > Mark > > > > > > > mark_fenbers.vcf (360 bytes) < > http://activemq.2283324.n4.nabble.com/attachment/4666998/0/mark_fenbers.vcf > > > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Wire-Format-Negotiation-Timeout-Say-what-tp4666972p4666998.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta
