activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Burton <>
Subject Should connection.createSession throw an exception if the connection isn't started?
Date Sat, 14 Jun 2014 20:19:24 GMT
So this bit me… mostly because I'm new to activemq but also because
silently failing isn't fun.

You can create a connection, create a producer, send messages on it, and
attempt to receive messages, all while the connection hasn't been started.

So my code compiled, but of course no IO was begin performed.

Which was obviously rather confusing.

It would seem that the best strategy is to throw an exception if you try to
create a session on a connection that isn't started.

Is there a reason why you would want a connection that's NOT started?

Of course… ActiveMQ is rather stable and robust… so maybe this has been
discussed before and it's some sort of anti-pattern.  Though I can't
believe I'm the only one who has been bitten by this.



Location: *San Francisco, CA*
Skype: *burtonator*
… or check out my Google+ profile
War is peace. Freedom is slavery. Ignorance is strength. Corporations are

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message