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 gurantee first send first receive??

Post new topic  Reply to topic Goto page 1, 2  Next
 MQ gurantee first send first receive?? « View previous topic :: View next topic » 
Author Message
angka
PostPosted: Thu Dec 28, 2006 6:46 pm    Post subject: MQ gurantee first send first receive?? Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Does MQ gurantee that the first message sent will be the first message received from the same source going to the same destination?

Thanks.
Back to top
View user's profile Send private message
pathipati
PostPosted: Thu Dec 28, 2006 6:50 pm    Post subject: Reply with quote

Master

Joined: 03 Mar 2006
Posts: 296

Not everytime.
Back to top
View user's profile Send private message Yahoo Messenger
angka
PostPosted: Thu Dec 28, 2006 7:03 pm    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

What you mean by tt? You mean it may not be in sequence due to TCP/IP??
Back to top
View user's profile Send private message
pathipati
PostPosted: Thu Dec 28, 2006 7:06 pm    Post subject: Reply with quote

Master

Joined: 03 Mar 2006
Posts: 296

Yes, and it may be because of Priority.
Back to top
View user's profile Send private message Yahoo Messenger
angka
PostPosted: Thu Dec 28, 2006 7:18 pm    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

But shldn't TCP/IP in sequence? Cos it is connection dependent. for my system message priority is not set.. thanks
Back to top
View user's profile Send private message
pathipati
PostPosted: Thu Dec 28, 2006 7:49 pm    Post subject: Reply with quote

Master

Joined: 03 Mar 2006
Posts: 296

If you are using TCP/IP, and messages with no priority settings and no persistance then Probably MQ will guarantee FIFO.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu Dec 28, 2006 11:41 pm    Post subject: Reply with quote

Grand High Poobah

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

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.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
angka
PostPosted: Fri Dec 29, 2006 12:22 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

No the receiver cannot receive the message out of sequence.. is it possible to make it FIFO delivery? thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 29, 2006 12:31 am    Post subject: Reply with quote

Grand High Poobah

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

angka wrote:
Hi,

No the receiver cannot receive the message out of sequence.. is it possible to make it FIFO delivery? thanks


Because MQ treats each message as a separate item of work it's not possible to enforce message sequence. You can do tricks to make it more likely, but as the old saw goes "MQ assures delivery, it does not guarantee it".

Having a message dependant on the message imediately before it or after it is known as message affinity. Do a search in the forum for that term and you may find something of use. Message affinity is generally held to be anti-pattern and a bad thing, for reasons the search will throw up.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jsware
PostPosted: Fri Dec 29, 2006 12:32 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

angka wrote:
Hi,

No the receiver cannot receive the message out of sequence.. is it possible to make it FIFO delivery? thanks
You can have messages delivered in order via a number of mechanisms:

1. Chain them via the CorrelID. Have the "first message" use a fixed correl ID (e.g. all 0s) and each next message has the msgid of the previous message. Get the first, then use the msg id on a match option for the next message's correl id.

2. You might be able to use the msg seq number and match on sequence number. I have not tried this.

3. Follow the instructions under MQPUT usage notes item 2 very closely. Some of these will stop your application scaling well.

Alternatively change your design so that out of sequence messages are handled gracefully. Always the best option IMHO.
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 29, 2006 12:39 am    Post subject: Reply with quote

Grand High Poobah

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

scottj2512 wrote:
You can have messages delivered in order via a number of mechanisms:

1. Chain them via the CorrelID. Have the "first message" use a fixed correl ID (e.g. all 0s) and each next message has the msgid of the previous message. Get the first, then use the msg id on a match option for the next message's correl id.


Pedantically, that doesn't ensure delivery by MQ is in sequence but that the application receives messages in sequence. While this is the correct place to put the logic, you might be better advised to read the messages off as they arrive and use a sequence number added to the message body. Saves messages getting stuck on the queue if the chain breaks.

And of course requires code at sender & reciever whatever method you use. I think angka is attempting to do this within MQ.

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.

scottj2512 wrote:

3. Follow the instructions under MQPUT usage notes item 2 very closely. Some of these will stop your application scaling well.


Applications with message affinity seldom scale. It's one of the reasons it's disliked.

scottj2512 wrote:

Alternatively change your design so that out of sequence messages are handled gracefully. Always the best option IMHO.


Gets my vote!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
angka
PostPosted: Fri Dec 29, 2006 12:58 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Thanks for the prompt reply. =) I will look into those alternative. btw channel commit the transaction of the messages after the number stated in the channel Batch size attribute is reached, doesn't it check for the sequence?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 29, 2006 1:07 am    Post subject: Reply with quote

Grand High Poobah

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

angka wrote:
doesn't it check for the sequence?


No.

What would it do if it found a message missing from the sequence due to application failure? Or a duplicate? Fail? Dump them to the DLQ? Plus the additional overhead that would add to the MCA. It's not the job of MQ as built to determine these things. As scottj2512 points out, message sequence is an application requirement not an MQ one.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Dec 29, 2006 1:13 am    Post subject: Reply with quote

Grand High Poobah

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

I hesitate to mention this, but...

The other thing you could do is build a channel exit to check sequence. Exits are not to be attempted lightly and if improperly written can cause all sorts of problems. Even if it worked, you'd have all the problems I talk about in the previous post - what to do if a message is out of sequence? Also remember that any message sent across the channel would pass through the exit, so if another class of message without a sequence requirement was added the exit would need to recognise this or you'd need to define a new channel.

I mention it because it is an option, but one I urge you to dismiss as a possibility. It's a first class ticket to pain & misery.

The far better option is to remove the necessity for sequencing within the application.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
angka
PostPosted: Fri Dec 29, 2006 1:22 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Thanks for the reply.. Think i will let the application do it.. Happy New Year..

Cheers
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 » MQ gurantee first send first receive??
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.