| Author |
Message
|
| Vitor |
Posted: Fri Dec 29, 2006 1:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
| angka wrote: |
Hi,
Thanks for the reply.. Think i will let the application do it.. Happy New Year..
Cheers |
Good Call!
Happy New Year to you as well... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| Michael Dag |
Posted: Fri Dec 29, 2006 2:31 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
| Vitor wrote: |
| pathipati wrote: |
| Probably MQ will guarantee FIFO. |
"Probably" is not a really good guarantee!
And no, MQ does not guarantee FIFO delivery. In the scenario you're describing where sender & receiver are one-to-one then "very probably" is as good as you're likely to get. If that's good enough for your process is a decision only you can make. |
also if you want to increase the "probability" remove all dead letter queues from the queuemanagers in the "FIFO" messages "path",
still it's better not to have message affinity as explained above... _________________ Michael
MQSystems Facebook page |
|
| Back to top |
|
 |
| Vitor |
Posted: Fri Dec 29, 2006 2:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
| Michael Dag wrote: |
| also if you want to increase the "probability" remove all dead letter queues from the queuemanagers in the "FIFO" messages "path" |
There are a number of tricks you can pull (like this one) to increase likelyhood. Like this one, it's much like getting more speed by putting a rocket engine in a Model T Ford. It can be done and it will make the car go much faster in a straight line. If later on you have a requirement to go round corners, you may encounter difficulties.
And woe betide you if you hit a bump in the road!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| Michael Dag |
Posted: Fri Dec 29, 2006 4:06 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
| Vitor wrote: |
| Michael Dag wrote: |
| also if you want to increase the "probability" remove all dead letter queues from the queuemanagers in the "FIFO" messages "path" |
There are a number of tricks you can pull (like this one) to increase likelyhood. Like this one, it's much like getting more speed by putting a rocket engine in a Model T Ford. It can be done and it will make the car go much faster in a straight line. If later on you have a requirement to go round corners, you may encounter difficulties.
And woe betide you if you hit a bump in the road!  |
you clearly missed my last line:
| Michael Dag wrote: |
still it's better not to have message affinity as explained above...
|
 _________________ Michael
MQSystems Facebook page |
|
| Back to top |
|
 |
| Vitor |
Posted: Fri Dec 29, 2006 4:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
| Michael Dag wrote: |
you clearly missed my last line:
| Michael Dag wrote: |
still it's better not to have message affinity as explained above...
|
 |
Didn't miss it, just thought I'd made my position on the evils of message affinity clear on early posts & thought I'd rant about the evils of not having DLQs for a change....
....I try and vary my rants to stay in practice.
For the record, I think you're quite right, it's better not to have message affiinity and I'm glad the final decision was to let the application sort it all out! _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| bruce2359 |
Posted: Fri Dec 29, 2006 8:15 am Post subject: |
|
|
Guest
|
Read "getting messages..." section of the Application Programmers Guide. It discusses physical vs. logical. There are many and varied reasons why a message might not arrive at a queue.
MQ offers Message Groups, a programming construct, to ensure that messages will be gotten from the queue in the same sequence as they were put to the queue - regardless of tcpip, other applications putting to the queue and/or getting from the queue. |
|
| Back to top |
|
 |
| pathipati |
Posted: Fri Dec 29, 2006 9:01 am Post subject: |
|
|
Master
Joined: 03 Mar 2006 Posts: 296
|
I guess angka got One-to-One setup..  |
|
| Back to top |
|
 |
| jsware |
Posted: Tue Jan 02, 2007 6:11 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
| Vitor wrote: |
| scottj2512 wrote: |
2. You might be able to use the msg seq number and match on sequence number. I have not tried this.
|
I would be surprised to discover this works.
|
I see nothing in the text describing MQMO_MATCH_MSG_SEQ_NUMBER in the programmer's reference saying that it must be used with another option. All it says is:
| Quote: |
Retrieve message with specified message sequence number.
This option specifies that the message to be retrieved must have a message sequence number that matches the value of the MsgSeqNumber field in the MsgDesc parameter of the MQGET call. This match is in addition to any other matches that may apply (for example, the group identifier).
If this option is not specified, the MsgSeqNumber field in the MsgDesc parameter is ignored, and any message sequence number will match. |
_________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
| Back to top |
|
 |
| bruce2359 |
Posted: Tue Jan 02, 2007 1:54 pm Post subject: |
|
|
Guest
|
MQMO_MATCH_MSG_SEQ_NUMBER
sc34-6595-00 Application Programming Guide, section entitled "Getting a specific message," page 127-128:
If you set the Version field of the MQMD structure to 2 or 3, you can use the GroupId, MsgSeqNumber, and Offset fields. Table 5 shows which message is retrieved for the possible settings of these fields.
From the table:
MQMO_MATCH_MSG_SEQ_NUMBER First message that matches MsgToken |
|
| Back to top |
|
 |
| angka |
Posted: Thu Sep 20, 2007 1:24 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I checked the MQ intercommunication redbook and found this
"The channel uses sequence numbers to assure that messages are delivered, delivered without duplication, and stored in the same order as they were taken from the transmission queue"
so this mean physically the messages will arrive at the local queue in the order it leaves the transmission queue... am i right? this is wat I want to know in the beginning. think the question i ask too vague.
Thanks. |
|
| Back to top |
|
 |
| Vitor |
Posted: Thu Sep 20, 2007 1:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
| angka wrote: |
so this mean physically the messages will arrive at the local queue in the order it leaves the transmission queue... am i right? this is wat I want to know in the beginning. think the question i ask too vague.
|
What it doesn't mean is that the messages will be presented to the getting application in this order. They probably will be, but consider the case where a block of 10 messages turn up, with the 4th message having a higher priority than the others. This message must be presented first in a priority queue, but what does the next get obtain? The 1st message or the 5th because that's where the queue cursor is? Likewise if there are 2 blocks of messages arriving chronologically close on a pure FIFO, which block becomes available first? And which will the queue manager present in response to a get?
The answer to your original question remains the same IMHO. WMQ does not guarantee to deliver messages in sequence, it will probably deliver them in sequence and that probably is a bad thing to base a design on.
Also see my rant earlier in this post about message affinity and how it makes you go blind, causes global warming, reduces cities to blighted wastelands, etc, etc, etc  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| bruce2359 |
Posted: Thu Sep 20, 2007 5:34 am Post subject: |
|
|
Guest
|
When the order of messages is required (and not otherwise ensured according to rules specified in the APG, APR and Intercomm manuals), programmers can create MQ Message Groups. Message Groups consist of one or more physical message comprising a logical message.
The MQPUTting application will need to code the appropriate put options to put messages as part of the Message Group with a GroupId (like MsgId and CorrelId) and Message sequence number. As stated in other posts here, the MQGETting application will need to specify the appropriate get options (message in group) to ensure that messages are received in same order as they were MQPUT.
Yes, message affinity will cause heartburn; but some applications are architected that way. |
|
| Back to top |
|
 |
| mvic |
Posted: Fri Sep 21, 2007 1:24 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
| Back to top |
|
 |
| jsware |
Posted: Thu Sep 27, 2007 1:40 pm Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
| bruce2359 wrote: |
MQMO_MATCH_MSG_SEQ_NUMBER
sc34-6595-00 Application Programming Guide, section entitled "Getting a specific message," page 127-128:
If you set the Version field of the MQMD structure to 2 or 3, you can use the GroupId, MsgSeqNumber, and Offset fields. Table 5 shows which message is retrieved for the possible settings of these fields.
From the table:
MQMO_MATCH_MSG_SEQ_NUMBER First message that matches MsgToken |
When I read this section of the APG, it still reads like you can specify just the MQMO_MATCH_MSG_SEQ_NUMBER option to match on individual MQMD fields. Table 5 footnote 2 states that the MQMO flags can be used in combination. It does not state that they must be used in combination, nor does it say they cannot be used individually. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
| Back to top |
|
 |
| jefflowrey |
Posted: Thu Sep 27, 2007 1:49 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
| scottj2512 wrote: |
| When I read this section of the APG, it still reads like you can specify just the MQMO_MATCH_MSG_SEQ_NUMBER option to match on individual MQMD fields. Table 5 footnote 2 states that the MQMO flags can be used in combination. It does not state that they must be used in combination, nor does it say they cannot be used individually. |
The Options flags affect which MatchOptions are in use.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzak.doc/js00862.htm
If you want to match on a specific MsgSeqNum, you have to NOT specify MQGMO_LOGICAL_ORDER.
There's more information on how matching is done in a table at that link. _________________ I am *not* the model of the modern major general. |
|
| Back to top |
|
 |
|
|