Hi Robbie, 

We need one suggestion from you for handling JMS exception in better way. 

Pre Conditions- We have 
a) One javax.jms.Connection
b) Registered exception listner. So we will get connection related exception
on "onException" block
c) 50+ javax.jms.Session
d) 32+ javax.jms.MessageProducer (every producer have separate Session)
e) 6 javax.jms.MessageConsumer for Queue_NAME="test1" (with separate
Session)
f)  6 javax.jms.MessageConsumer for Queue_NAME="test2" (with separate
Session)


Condition - We got InvalidDestinationException for consumer (queue=TEST1) on
"onException" block

As I understand from online forum, I should to follow below approach in
"onException" block.
Step 1. public onException(JMSException e)
        {
        connection.setExceptionListener(null);
        connection.close();
        connectToServer();
        }
Step 2.         createConsumers(); --> For "test1" queue
Step 3.         createConsumers(); --> For "test2" queue

Concern - We have concern on recreating connection on every thrown exception
on "onException" block. 
                  As "InvalidDestinationException" is not a connection 
exception,
connection is still valid, we can still publish message with same connection
object.
                  If we reset the connection then we need to reset consumer(for 
queue
"Test2") and producer as well, which is not ideal.

Problems - As we receive "JMSException" object in onException, and
"JMSException" is the super exception of all JMS Exception.
                   So we can't identify that which exception are related with 
connection
exception (connection broken from Broker). 
                   So we can't filter that reset connection of this type of 
exception. 


Could you please suggest best practice to perform action on "onException"
block ?

Regards,
Abhishek Kumar




--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to