Suppose a process puts a message in queue and say a mdb receives it and sends a mail to say client. Now if during mdb is sending message, any exception occurs, message is not sent. Then what will happen to the message. What will be the queue state, Will the unsent message be sent back to the queue, If not how can that be achieved.
No matter how much you know today, you will have to know more tomorrow.<br /> Hakunamatata !!!
Originally posted by sergiu truta: If you throw an exception from inside onMessage(), the container will know that it has to put the message back into the Queue.
which exception should be thrown. throwing JMSException will do?? of any other exception has to be thrown.
No matter how much you know today, you will have to know more tomorrow.<br /> Hakunamatata !!!
Throw a system exception or rollback the transaction. For example: inside your MDB you have: private MessageDrivenContext ctx; public void onMessage(Message msg){ .... //if you want to put the message back into the queue ctx.setRollbackOnly();
Try these options.
...watch me...as I'm walking the path...
What are you doing? You are supposed to be reading this tiny ad!
a bit of art, as a gift, the permaculture playing cards