Author |
Message
|
vald |
Posted: Wed Jun 11, 2008 8:36 am Post subject: Asynchronous vs synchronous |
|
|
Novice
Joined: 16 Nov 2007 Posts: 17
|
It is known that TCP ensures packets delivery in order, in sequence.
What about Asynchronous message queue. When it re-transmit "lost" messages, will it ensure messages delivery in proper order? |
|
Back to top |
|
 |
vennela |
Posted: Wed Jun 11, 2008 8:44 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
MQ is not designed to deliver messages in order |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jun 11, 2008 11:01 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Messages will be delivered in the same order that they were put to the queue IF:
If the queue is local to the putting application AND
no other application is putting messages to the same queue AND
all messages are put syncpoint (unit of work) OR all messages are put outside a unit of work AND
no other application is getting messages from the queue.
If the queue is not local to the putting application AND
above plus
no messages end up on the dead letter queue
(there is something else that goes here...)
If order of retrieval of messages is important to you, MQ offers Message Groups. Refer to the WMQ Application Programming Reference and WMQ Application Programming Guide for details. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 11, 2008 12:05 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Messages that have to arrive in a specific order are said to have "affinity"
Search the forum for discusions on why "message affinity" is a bad idea _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 11, 2008 3:12 pm Post subject: Re: Asynchronous vs synchronous |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
vald wrote: |
It is known that TCP ensures packets delivery in order, in sequence.
What about Asynchronous message queue. When it re-transmit "lost" messages, will it ensure messages delivery in proper order? |
I beg to differ. That guarantee is only given if the packets travel the same route. If there is a route change ( a router crashed along the way / or was brought back up ) all bets are off. I understand that the next layer is then responsible for reordering the packets being part of the same communication.
More than I ever wanted to know about TCP/IP (but was afraid to ask).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Jun 11, 2008 6:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
synchronous = time dependent = close coupled
asynchronous = time independent = loosely coupled
asynchronous messaging interface = An app puts a message which is to be picked up by another app at some indeterminate future point in time. The time could be milliseconds through to months.
synchronous messaging interface = An app puts a message which is to be picked up by another app at within an expected future point in time. The receiving app usually responds with a "reply" message which is picked up by the sending app within a specified "wait interval". The expectation for time would usually be in the range of a few seconds to a few minutes.
Message order is not guaranteed in MQ. If you want ordering, the apps need to have logic to do message affinity. Some options are:
1. Use CorrelationId as a sort key or sequence identifier.
2. Store messages into a DB table and then read back the rows in the desired sorted order.
3. Combine the sorted message into one big message. _________________ Glenn |
|
Back to top |
|
 |
sunny_30 |
Posted: Wed Jun 11, 2008 7:17 pm Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
WebsphereMQ supports Transmission-protocols TCP/IP or SNA LU6.2
Non-persistent messages can be lost on MQ, they are not re-transmitted if lost.
Set the put-application & MQ queue-settings to FIFO if order needs to be preserved. Also make sure the application isnt running on multiple-threads that can mishap the sequence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jun 11, 2008 8:14 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
Non-persistent messages can be lost on MQ, they are not re-transmitted if lost. |
Assured delivery means that WMQ wants to deliver all your messages - with no loss or duplication. This includes non-persistent messages, as well as persistent messages.
Messages are sent across channels in units of work. In the event of a channel failure, messages will be backed out and resent, if necessary.
IF you specify NPMSPEED(FAST) on your sender channel, AND send a non-persistent message, AND the message can't be delivered to the destination queue on the target system, AND no DLQ exists on the target system, these messages are discarded. They are not lost.
This is very well documented in the WMQ Intercommunications manual. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|