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 Discussion » Asynchronous vs synchronous

Post new topic  Reply to topic
 Asynchronous vs synchronous « View previous topic :: View next topic » 
Author Message
vald
PostPosted: Wed Jun 11, 2008 8:36 am    Post subject: Asynchronous vs synchronous Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Wed Jun 11, 2008 8:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

MQ is not designed to deliver messages in order
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bruce2359
PostPosted: Wed Jun 11, 2008 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jun 11, 2008 12:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 11, 2008 3:12 pm    Post subject: Re: Asynchronous vs synchronous Reply with quote

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
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Wed Jun 11, 2008 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
sunny_30
PostPosted: Wed Jun 11, 2008 7:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 11, 2008 8:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Asynchronous vs synchronous
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.