Author |
Message
|
lookman |
Posted: Tue Oct 18, 2005 8:33 am Post subject: Error/Exception handling in MQSeries |
|
|
Novice
Joined: 21 Sep 2005 Posts: 10
|
Hi,
What is the robust way to handle any exception generated while doing any operation in MQ Series for e.g. putting messages on queue.
Kindly explain.
Thanks,
Lucky. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 18, 2005 9:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
This goes way beyond an MQSeries Topic !
The answer: it depends :
a) language
b) API
c) application
d) intentions....
exemple : java :... what is the best way to handle exceptions in java ?
Be WAY more specific and maybe you'll get an answer making more sense! |
|
Back to top |
|
 |
lookman |
Posted: Tue Oct 18, 2005 9:20 am Post subject: Error/Exception handling in MQSeries |
|
|
Novice
Joined: 21 Sep 2005 Posts: 10
|
Yes,
I am using java.
Actually the underlying application using MQ series messaging application to send/receive messages.
I want to handle any exception that might prevent ideal behaviour of MQ for any operation done on MQ. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 18, 2005 9:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well,
Make sure you catch all the exceptions and check all the return codes.
If using JMS allways go fish for the linked exception and the reason code.
Enjoy  |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 18, 2005 9:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There is no single best practice for this.
Other than that classes that act as utillity classes for other classes should handle all errors that do not fit into the contract that the utility class exposes.
A really good thing to do when handling MQ errors is to report the reason code and the completion code, assuming that they indicate an error and not an application logic condition (like no more messages).
How you handle errors in your code will depend very heavily on what your code is trying to do, the requirements of the project you are working on, the infrastructure you have available, and the development standards and practices of your organization.
What errors your code handles and what errors it throws further up the exception stack into other classes is highly dependant on the contract you are trying to create, and the logic that you are trying to encapuslate. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
lookman |
Posted: Tue Oct 18, 2005 9:47 am Post subject: Error/Exception handling in MQSeries |
|
|
Novice
Joined: 21 Sep 2005 Posts: 10
|
Ok fine.
Any idea how to send back the message to the sender i.e retrying message delivery.
Thanks. |
|
Back to top |
|
 |
lookman |
Posted: Tue Oct 18, 2005 9:48 am Post subject: Error/Exception handling in MQSeries |
|
|
Novice
Joined: 21 Sep 2005 Posts: 10
|
In case the message is undelivered (Adding a line to my above query)
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 18, 2005 10:00 am Post subject: Re: Error/Exception handling in MQSeries |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
lookman wrote: |
Any idea how to send back the message to the sender i.e retrying message delivery. |
These are two completely different concepts. Once MQ has accepted a message from a sender, it guarantees message delivery - at least, options can be set up and qmgrs can be configured such that this is true.
Consequently, almost all MQ apps never worry about retrying message delivery once MQ has accepted the message.
If MQ doesn't accept a message, it immediately notifies the sender, with an exception that tells the sender that the message has not been sent.
You should read the Application Programming Guide. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 18, 2005 10:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Also, this forum is for a specific product called "WebSphere MQ Everyplace". This is not the same product as WebSphere MQ.
If your questions are really about WebSphere MQ Everyplace, than this is appropriate. If, as I suspect, you don't understand the difference between the two products, then you have posted your question in the wrong place.
Your question should have gone in the API forum or in General Discussion. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
lookman |
Posted: Tue Oct 18, 2005 10:05 am Post subject: |
|
|
Novice
Joined: 21 Sep 2005 Posts: 10
|
|
Back to top |
|
 |
|