[jboss-user] [JBoss Messaging] - Re: deleting messages rather than blocking if server down fo

timfox do-not-reply at jboss.com
Wed Jul 8 05:36:09 EDT 2009


Adrian-

Are your client threads calling send() on the same ClientProducer (core ) or MessageProducer (JMS) instance? If you do this you would have to synchronize access in your client application since neither JMS MessageProducers or core ClientProducer instances are designed to be used by more than one thread at a time,

Alternatively if you're creating a new MessageProducer for each message sent - that would also be frowned upon as an anti-pattern. Sessions/Producers/Consumers should always be reused between messages sent/consumed (unless you're not worried about performance).

If you enable auto reconnect you do so on the presumption that  your server has not really failed but there is a temporary network glitch (like someone has pulled out the cable for a while), and when the network comes back the client will be able to automatically reconnect its session(s) with the sesssion(s) still remaining on the server and carry on as if nothing  had happened (this is transparent reconnection). In your case the server has really failed so on recovery the server sessions will clearly not be there any more (since the server was restarted) and they won't be able to connect. That's why you don't get the exception until the client has tried to reconnect and not found the session(s) there. If you turn off auto reconnection you'll get the exception sooner.



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242372#4242372

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242372



More information about the jboss-user mailing list