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 » MQ Message retrieval

Post new topic  Reply to topic
 MQ Message retrieval « View previous topic :: View next topic » 
Author Message
guest468
PostPosted: Wed Dec 06, 2006 1:00 pm    Post subject: MQ Message retrieval Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

Hi
I have a question on MQ get.
what I understand is when an application connects a QM and invokes a MQGET the message will not removed immediately from the queue but only after the application commits. Is this applicale irrespective of persistence or under transactional control(MQBEGIN or not)?
And QM detects that application is down when it sees that connection is broken; is this correct? And what happens if an application never issues commit or disconnects , is there any timeout period till which QM waits and after that it rollsback the message back to the queue?

Actually we are seeing a problem in our environment. The application connects to the QM, gets the message and when we deliberately bring the application down the message is not rolledback to the queue(we checked the queue). But interestingly the application somehow gets the message back when it comes up. What would have happened in this scenario?
Thanks
Back to top
View user's profile Send private message
killer
PostPosted: Wed Dec 06, 2006 1:18 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Jul 2006
Posts: 35

Quote:
[he application connects to the QM, gets the message]


As per ur comment, the application is already receiving the message.
So it already got the message.

Following are the steps in a simple senario:-

1)Aplication make connection with QM
2)Access the Q to get the message.
3)application disconnect .

If application performed step 1 and failed in step 2,
then message is not yet received.

If application perfomed step2 and failed after step 3,
then it has got the message and after that it failed.


Last edited by killer on Wed Dec 06, 2006 1:25 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Dec 06, 2006 1:21 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

An MQ program has to be specifically coded to use any form of transactional control over messages.

If it is not specifically coded to do so, then the MQGET is automatically destructive, and the message is immediately removed entirely from the queue.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
guest468
PostPosted: Wed Dec 06, 2006 1:28 pm    Post subject: Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

Thanks Jeff,

The application is reteiving the message under transactional control (MQBEGIN). And during the processing we brought down the application deliberately. Now MQ should have rolledback the message back to the input queue but we did not see the message there. The application completely h/w based and the concerned vendors are saying there isn't any cache or any kind of storage. Still when we brought the application up the it actually retrieved the message and sent an output message to o/p queue. What would have happened?
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Dec 06, 2006 1:55 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

When you say that you "didn't see the message" after the application was killed ... does that mean you didn't see curdepth go back up, or that you couldn't browse the message, or did you try retrieving the message via something like amqsget?

In any case, Jeff's point was that you also need to use MQGMO_SYNCPOINT on the MQget calls, otherwise the MQGET is outside of the UOW started by MQBEGIN.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
guest468
PostPosted: Wed Dec 06, 2006 1:58 pm    Post subject: Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

Wayne, we used amqsget.
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Dec 06, 2006 2:00 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

guest468 wrote:
Wayne, we used amqsget.
and the application uses MQGMO_SYNCPOINT? Can you confirm that??
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
guest468
PostPosted: Wed Dec 06, 2006 2:13 pm    Post subject: Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

yep that's what the vendor is saying. (the application is purely hardware based).

NOTE: Actually I thought the message will be put under sync if we specify MQBEGIN. Also does the persistence play any role in sync?
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Dec 06, 2006 2:24 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

guest468 wrote:
yep that's what the vendor is saying. (the application is purely hardware based).
Huh?
guest468 wrote:

NOTE: Actually I thought the message will be put under sync if we specify MQBEGIN. Also does the persistence play any role in sync?
No, you must specify MQxMO_SYNCPOINT (x=G or P)... it has nothing at all to do with persistence. If you don't specify syncpoint, then the messages are in a different "single" unit of work.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
guest468
PostPosted: Thu Dec 07, 2006 11:03 am    Post subject: Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

Out of curiosity, what happens if an application tries to get a message under sync and waits forever. In this case, the message is locked forever. Does QMGR tries to resolve this? I mean does it wait for some time and then rollsback the message?
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Dec 08, 2006 8:20 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

guest468 wrote:
Out of curiosity, what happens if an application tries to get a message under sync and waits forever. In this case, the message is locked forever. Does QMGR tries to resolve this? I mean does it wait for some time and then rollsback the message?

It's difficult to understand the question here. Could you post a code sample please, and it will be possible to comment.
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Dec 08, 2006 11:51 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I think he is talking about a 'long running transaction', and I agree this whole thread is a little confusing....
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
guest468
PostPosted: Mon Dec 11, 2006 11:13 am    Post subject: Reply with quote

Centurion

Joined: 30 May 2006
Posts: 146
Location: NY

Sorry about the confusion. Actually I am trying to understand the QMGR's role in resolving a long running transaction. Let's say an application starts the message get operation under sync and for some reason it hangs but the connection is kept alive (ex: application is waiting indefinitely for something else before commit). In this scenario the message is stuck forever. Does the QMGR tries to resolve this situation?
Thanks.
Back to top
View user's profile Send private message
mvic
PostPosted: Mon Dec 11, 2006 12:45 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

guest468 wrote:
Does the QMGR tries to resolve this situation?
Thanks.

No, if the administrator believes an app is holding open a very long transaction, then the best option is to end the app. Then, supposing the app did not call MQDISC, the queue manager will roll back the long running transaction within 10 seconds.
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 » General IBM MQ Support » MQ Message retrieval
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.