Author |
Message
|
Martin_Wieland |
Posted: Thu Apr 27, 2006 4:11 am Post subject: Trigger last? |
|
|
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 |
|
 |
jefflowrey |
Posted: Thu Apr 27, 2006 4:19 am Post subject: |
|
|
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 |
|
 |
DryHeatDave |
Posted: Thu Apr 27, 2006 7:57 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Thu Apr 27, 2006 8:08 am Post subject: |
|
|
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 |
|
 |
DryHeatDave |
Posted: Thu Apr 27, 2006 12:02 pm Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Thu Apr 27, 2006 12:05 pm Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 12:15 pm Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Thu Apr 27, 2006 12:17 pm Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 12:24 pm Post subject: |
|
|
 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 |
|
 |
PeterPotkay |
Posted: Thu Apr 27, 2006 3:13 pm Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Thu Apr 27, 2006 3:32 pm Post subject: |
|
|
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 |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 3:33 pm Post subject: |
|
|
 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 |
|
 |
fjb_saper |
Posted: Thu Apr 27, 2006 7:56 pm Post subject: |
|
|
 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
- have multiple network paths from sender to receiver
- sent the messages and in particular the trigger message with different priority
- 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 |
|
 |
EddieA |
Posted: Thu Apr 27, 2006 9:33 pm Post subject: |
|
|
 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 |
|
 |
PeterPotkay |
Posted: Fri Apr 28, 2006 5:59 am Post subject: |
|
|
 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 |
|
 |
|