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 » General IBM MQ Support » Issue when messgae is fetched but error occur

Post new topic  Reply to topic
 Issue when messgae is fetched but error occur « View previous topic :: View next topic » 
Author Message
riyaz_tak
PostPosted: Thu Jan 24, 2019 9:23 am    Post subject: Issue when messgae is fetched but error occur Reply with quote

Voyager

Joined: 05 Jan 2012
Posts: 92

Hi

IBM MQ version 7.5

OS Solaris 10

We have client program which reads the message from Local queues and pass them to other components.
My question is what happens when we have fetched the message but failed to pass to other component (because of some issue).
What happens to message in this case ? Is it lost ? How can we avoid or handle such scenario?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jan 24, 2019 9:29 am    Post subject: Re: Issue when messgae is fetched but error occur Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

riyaz_tak wrote:
What happens to message in this case ? Is it lost ?


Depends entirely on how your application is coded. If you've explicitly or implicitly committed the read of the message, then the message is lost because your application has no copy of it (because of the issue) and you told MQ it was ok to delete the message because you'd finished processing it. If not, then the message will roll back onto the queue.

riyaz_tak wrote:
How can we avoid or handle such scenario?


Make sure the message read and the sending to the other component (it's not clear if you mean sent by MQ or some other method and it really makes no difference) are in the same unit of work and you don't commit the read until the send succeeds.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 24, 2019 9:39 am    Post subject: Re: Issue when messgae is fetched but error occur Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Vitor wrote:
Depends entirely on how your application is coded.


Each MQ API call returns to the application a ReasonCode that explains success or failure of the call. If there is a database involved, it will return to the app the same kind of information.

The app is responsible for recognizing the success or failure, and to take appropriate action (commit or backout) the work in progress.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jan 24, 2019 1:20 pm    Post subject: Re: Issue when messgae is fetched but error occur Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

riyaz_tak wrote:
We have client program which reads the message from Local queues and pass them to other components.
My question is what happens when we have fetched the message but failed to pass to other component (because of some issue).
What happens to message in this case ? Is it lost ? How can we avoid or handle such scenario?

Simplest way would be to ensure that the message is read by the client program from the local queue using a transaction, e.g. MQGMO_SYNCPOINT, and then if there is a failure, rollback the transaction, e.g. MQBACK, and then the message will be there to read again.

You don't say what language your client program is written in so I have not provided code examples. If you want to show us your code, we could advise where to make changes.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
riyaz_tak
PostPosted: Thu Jan 24, 2019 2:23 pm    Post subject: Reply with quote

Voyager

Joined: 05 Jan 2012
Posts: 92

Thanks everyone.
Mq client is written in Java 8.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jan 24, 2019 3:22 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

Glad you're all sorted.

Please feel free to ask any further questions if you have them.

Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Thu Jan 24, 2019 3:25 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Good idea to review error logs. Both MQ on client platform and server platform have error log directories with error log files in them.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
riyaz_tak
PostPosted: Thu Jan 24, 2019 4:25 pm    Post subject: Reply with quote

Voyager

Joined: 05 Jan 2012
Posts: 92

hughson wrote:
Glad you're all sorted.

Please feel free to ask any further questions if you have them.

Cheers,
Morag


It's not sorted yet.i need to try this thing tomorrow.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 24, 2019 4:44 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Is this a new problem? If so, what has changed since it last worked successfully?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jan 24, 2019 9:07 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

riyaz_tak wrote:
hughson wrote:
Glad you're all sorted.

Please feel free to ask any further questions if you have them.

Cheers,
Morag


It's not sorted yet.i need to try this thing tomorrow.

Ok, well, if you need further help, please give a few more details once you have tried it tomorrow.

All the best,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
riyaz_tak
PostPosted: Fri Jan 25, 2019 10:01 am    Post subject: Reply with quote

Voyager

Joined: 05 Jan 2012
Posts: 92

It worked like a charm.
Thanks everyone
Back to top
View user's profile Send private message
hughson
PostPosted: Fri Jan 25, 2019 1:19 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand


_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Issue when messgae is fetched but error occur
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.