|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Exception Handling depending upon scenarios |
« View previous topic :: View next topic » |
Author |
Message
|
mqnewuser |
Posted: Fri Oct 06, 2006 8:06 am Post subject: Exception Handling depending upon scenarios |
|
|
Newbie
Joined: 06 Oct 2006 Posts: 1
|
Hi,
I am using WAS5.1 with WMQ 5.3. I am using MDBs as message consumers.
1) The problem i have is that i want to handle MDBs differently based on the type of exception. For example -- lets say if there is a data problem with my message then i want to move it to the error queue/log it and let the MDB continue process subsequent messages. but lets say if the DB is down then i want to stop the listener port so that the messages stay there until the DB comes up. how can i achieve this? If i specify a backout queue then in the case of exceptions all the msgs are sent to that backout Q after the re-delivery max has reached. Is there a possible way?
2) Apart from throwing JMSException in the MDB its not recommended to throw any other exception in the MDB right?
3) This is different from the two problems above...this is well known that MDBs could start processing the msg even before the application has fulyl started. This happens with my application quite often, as a result the msgs get rejected because its not able to find the digester xml ( i am using commons digester to parse the msgs). In weblogic there is a property start-mdbs-with-application but does anyone know if there is anything for WAS? I know this is a wrong place to ask a qns about WAS but since this is related to MDBs i decided to put it here.
TIA, |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Oct 06, 2006 2:32 pm Post subject: Re: Exception Handling depending upon scenarios |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqnewuser wrote: |
Hi,
I am using WAS5.1 with WMQ 5.3. I am using MDBs as message consumers.
1) The problem i have is that i want to handle MDBs differently based on the type of exception. For example -- lets say if there is a data problem with my message then i want to move it to the error queue/log it and let the MDB continue process subsequent messages. but lets say if the DB is down then i want to stop the listener port so that the messages stay there until the DB comes up. how can i achieve this? If i specify a backout queue then in the case of exceptions all the msgs are sent to that backout Q after the re-delivery max has reached. Is there a possible way? |
Quite easy. Do not supply a backout threshold and do not supply a backout queue. In the error handling of the MDB handle the cases you need and throw the exception if you want the MDB blocked...
mqnewuser wrote: |
2) Apart from throwing JMSException in the MDB its not recommended to throw any other exception in the MDB right? |
Read the WAS manual and the red books. It is defined quite clearly what is authorized and what is not. On top of this you have the method signature (contract, API) to guide you.
mqnewuser wrote: |
3) This is different from the two problems above...this is well known that MDBs could start processing the msg even before the application has fulyl started. This happens with my application quite often, as a result the msgs get rejected because its not able to find the digester xml ( i am using commons digester to parse the msgs). In weblogic there is a property start-mdbs-with-application but does anyone know if there is anything for WAS? I know this is a wrong place to ask a qns about WAS but since this is related to MDBs i decided to put it here.
TIA, |
Have the MDB grab hold of some class that initializes in such a way it goes into a loop until the DB is up??? (Just a suggestion...) _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|