ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Telemetry / Low Latency Messaging / Everyplace » Error/Exception handling in MQSeries

Post new topic  Reply to topic
 Error/Exception handling in MQSeries « View previous topic :: View next topic » 
Author Message
lookman
PostPosted: Tue Oct 18, 2005 8:33 am    Post subject: Error/Exception handling in MQSeries Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 18, 2005 9:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
lookman
PostPosted: Tue Oct 18, 2005 9:20 am    Post subject: Error/Exception handling in MQSeries Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 18, 2005 9:32 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Tue Oct 18, 2005 9:35 am    Post subject: Reply with quote

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
View user's profile Send private message
lookman
PostPosted: Tue Oct 18, 2005 9:47 am    Post subject: Error/Exception handling in MQSeries Reply with quote

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
View user's profile Send private message
lookman
PostPosted: Tue Oct 18, 2005 9:48 am    Post subject: Error/Exception handling in MQSeries Reply with quote

Novice

Joined: 21 Sep 2005
Posts: 10

In case the message is undelivered (Adding a line to my above query)

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 18, 2005 10:00 am    Post subject: Re: Error/Exception handling in MQSeries Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 18, 2005 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message
lookman
PostPosted: Tue Oct 18, 2005 10:05 am    Post subject: Reply with quote

Novice

Joined: 21 Sep 2005
Posts: 10

Ok Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Telemetry / Low Latency Messaging / Everyplace » Error/Exception handling in MQSeries
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.