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 » Trigger last?

Post new topic  Reply to topic Goto page 1, 2  Next
 Trigger last? « View previous topic :: View next topic » 
Author Message
Martin_Wieland
PostPosted: Thu Apr 27, 2006 4:11 am    Post subject: Trigger last? Reply with quote

Newbie

Joined: 27 Apr 2006
Posts: 2
Location: Netherlands

Hi,
I am very new to MQ/Series and have a question that may seem trivial to you, but I cannot find any good information that covers it. Changes are that I just searched with the wrong arguments, so I hope someone is able to help me!

We are running version 5.3.1 on z/OS 1.4 and what we want to do is to start a local process as soon as the last message in a certain queue has been arrived. More specific: a remote host puts a batch of messages on a queue, and as soon as the last message is received by our MQM we want to start a batch job that processes all the received messages. We know that we can trigger "first", "every" and "nth", but not last. We found out that we may encounter a delay of up to 15 minutes between the remote put of the last message and the time we receive it. We tried to have the remote host send a special trigger message, but this was not reliable: we received it while the transmission of the data messages was not yet complete.

Is there any way to do this? How can we determine if the last message was put on a queue, eg. trap something like a disconnect from the remote que manager?

Any suggestions are welcome!

Regards,
Martin Wieland
Neckermann.com
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 27, 2006 4:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The "last" message on the queue is only the "last" message until the "next" message comes in.

You can use grouping, and have your "batch" application do a get with wait and include the option to wait until the group is complete.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DryHeatDave
PostPosted: Thu Apr 27, 2006 7:57 am    Post subject: Reply with quote

Apprentice

Joined: 21 Mar 2006
Posts: 28
Location: Phoenix, AZ

Define a separate queue, with a trigger event. When sending the last message, put a message on the separate queue.
_________________
SCJP2
IBM Cert. Solutions Designer for Websphere MQ 5.3
Not a certified mainframer - just been doing it a real long time.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 27, 2006 8:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

DryHeatDave wrote:
Define a separate queue, with a trigger event. When sending the last message, put a message on the separate queue.


Martin_Wieland wrote:
We tried to have the remote host send a special trigger message, but this was not reliable: we received it while the transmission of the data messages was not yet complete.


The real question is why
Martin_Wieland wrote:
We found out that we may encounter a delay of up to 15 minutes between the remote put of the last message and the time we receive it.


This should be troubleshot, as it's not normal at all.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
DryHeatDave
PostPosted: Thu Apr 27, 2006 12:02 pm    Post subject: Reply with quote

Apprentice

Joined: 21 Mar 2006
Posts: 28
Location: Phoenix, AZ

Is it possible to define a trigger event (on the destination queue), with a condition that can be matched by the final message in the group /batc/whatever - like trigger when a message hits the queue, with a custom format of MQGODOSTUFFNOW (or whatever) hits the queue ?
_________________
SCJP2
IBM Cert. Solutions Designer for Websphere MQ 5.3
Not a certified mainframer - just been doing it a real long time.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 27, 2006 12:05 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Not unless you write a new process to browse your destination queue and act like a trigger monitor (without using an initiation queue).

Well.

Okay.

If you know that a) the queue will always be completely empty after each batch has been processed, and b) each batch will always exactly the same size, THEN you can trigger on depth at that exact size (-1).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Apr 27, 2006 12:15 pm    Post subject: Reply with quote

Jedi Knight

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

For real fun: what about an API exit that watches the messages being put on the queue and then writing a TM to the INITQ when the last message arrives?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Thu Apr 27, 2006 12:17 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

wschutz wrote:
For real fun: what about an API exit that watches the messages being put on the queue and then writing a TM to the INITQ when the last message arrives?


Which one is the "last" one?

Isn't this exactly what Grouping is for?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Apr 27, 2006 12:24 pm    Post subject: Reply with quote

Jedi Knight

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

Exactly... you'd watch a group a messages come across, and when the last one in the group arrives (MQMF_LAST_MSG_IN_GROUP), the exit creates the trigger message.

ps..I just noticed this is a z/OS environment, so we're limited to the good old CICS API crossing exit.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
PeterPotkay
PostPosted: Thu Apr 27, 2006 3:13 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

wschutz wrote:
Exactly... you'd watch a group a messages come across, and when the last one in the group arrives (MQMF_LAST_MSG_IN_GROUP), the exit creates the trigger message.

But, just because you saw MQMF_LAST_MSG_IN_GROUP, that doesn't mean all the messages in the group actually made it yet. 99.999% of the time, yes, but the possability exists for messages to arrive out of order.

Hmmm, Trigger FIRST, EVERY, DEPTH. Would be kinda neat if there was a trigger type of GROUP, which would only trigger once a complete group of messages arrived.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 27, 2006 3:32 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Isn't that what MQGMO_ALL_MSGS_AVAILABLE does?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu Apr 27, 2006 3:33 pm    Post subject: Reply with quote

Jedi Knight

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

PeterPotkay wrote:
wschutz wrote:
Exactly... you'd watch a group a messages come across, and when the last one in the group arrives (MQMF_LAST_MSG_IN_GROUP), the exit creates the trigger message.

But, just because you saw MQMF_LAST_MSG_IN_GROUP, that doesn't mean all the messages in the group actually made it yet. 99.999% of the time, yes, but the possability exists for messages to arrive out of order.

Hmmm, Trigger FIRST, EVERY, DEPTH. Would be kinda neat if there was a trigger type of GROUP, which would only trigger once a complete group of messages arrived.
Yes, good point, so the exit would need to keep some sort of state of what messages have been received within groups... messy.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
fjb_saper
PostPosted: Thu Apr 27, 2006 7:56 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:


New postPosted: Thu Apr 27, 2006 11:08 am Post subject: Reply with quote
DryHeatDave wrote:
Define a separate queue, with a trigger event. When sending the last message, put a message on the separate queue.


Martin_Wieland wrote:
We tried to have the remote host send a special trigger message, but this was not reliable: we received it while the transmission of the data messages was not yet complete.


For this to happen you

  1. have multiple network paths from sender to receiver
  2. sent the messages and in particular the trigger message with different priority
  3. sent the trigger message through a different channel

Everything else being equal and making sure that none of the above cases occur, you should receive the trigger message last if you sent it last.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Thu Apr 27, 2006 9:33 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
Isn't that what MQGMO_ALL_MSGS_AVAILABLE does?

And if you combine that with a GET with Wait, you can trigger when the 1st message arrives, but your application won't start GETting the messages until there are all "present and correct".

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 28, 2006 5:59 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

EddieA wrote:
Quote:
Isn't that what MQGMO_ALL_MSGS_AVAILABLE does?

And if you combine that with a GET with Wait, you can trigger when the 1st message arrives, but your application won't start GETting the messages until there are all "present and correct".

Cheers,

Yeah, but you are not triggering here. You are doing a get with wait, and will only start getting when all the messages have arrived.

What I was envisioning was your app is idle. When all the messages arrived, the QM would generate a trigger message. Only then would your app fire up, knowing there was a complete group of messages ready for it. Doubt IBM will ever implement it....but probably would be more useful though than Trigger Every.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General IBM MQ Support » Trigger last?
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.