Author |
Message
|
solomon_13000 |
Posted: Wed Jul 16, 2008 6:43 am Post subject: asynchronous & synchronous |
|
|
Master
Joined: 13 Jun 2008 Posts: 284
|
I was told that asynchronous model is also known as you fire a message and forget about receiving a reply. Where else in a synchronous model you fire a message and then wait for a reply. When do we actually use asynchronous and synchronous model?. In a banking application for example.
Regards. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Jul 16, 2008 7:00 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
In a way you've answered your own question
Use asynchornous when you don't care about a reply. ("Fire and Forget")...for example...broadcasting an event, sending an alert.
Use synchronous when you require a reply ("Send and Depend")..updating a remote database, performing a credit check, OFAC checking etc.. |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Jul 16, 2008 7:09 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Assume an ATM Transaction (WithDraw) --> Synchronous.
bank Statement --> Asynchronous. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
solomon_13000 |
Posted: Wed Jul 16, 2008 2:36 pm Post subject: |
|
|
Master
Joined: 13 Jun 2008 Posts: 284
|
Can we say that a publish/subcribe model is a Asynchronous model?. For example a stock market publish their data and the brokers subscribe to it. |
|
Back to top |
|
 |
dkeister |
Posted: Thu Jul 17, 2008 12:38 pm Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
I'm not sure about the context of this request, but messages are asynchronous.
The MQMD MsgType field lets applications indicate how they want the receiver of the message to behave.
Setting MsgType to MQMT_DATAGRAM says to the receiving application "This message does not require a reply." This might be viewed as "Fire and Forget".
Setting MsgType to MQMT_REQUEST says to the receiving application "This message is the one that requires a reply." This might be viewed as "Send and Depend". In this case, the queue to which the receiving application should send the reply message is in the ReplyToQ/ReplyToQM fields and the reply message should have a MsgType of MQMT_Reply ("Reply to an earlier request message.")
In both the MQMT_DATAGRAM and MQMT_REQUEST, the message is asynchronous. In the case of the MQMT_REQUEST, the determination to act synchronously or asynchronously is an exercise left to the developer.
Examples:
A Pub/Sub is most likely treated as asynchronous.
A message to transfer a large amount of money may be treated logically as synchronous. That is, the requesting application sends a message and does nothing else until a reply is received.
A message to reserve a seat on an airplane might go either way. It could be setup exactly like the $$$ transfer. The requesting application may wait for a response but after a while, it might decide to not wait for the seat assignment any longer and get on with something else and throw away the reply as no longer being of interest when it is received. In this example, it starts out synchronous but might end up asynchronous. _________________ Dean Keister |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Jul 21, 2008 1:34 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
solomon_13000 wrote: |
Can we say that a publish/subcribe model is a Asynchronous model?. For example a stock market publish their data and the brokers subscribe to it. |
Synchronous and asynchronous has nothing to do with pub sub or point to point architecture.
As statedby all... if u want an acknowledgement and you wait for it before doing further processing then its synchronous..
If you do not want an acknowledgement or you do not wait for it and continue further processing then its Asynchronous.. _________________ Cheers |
|
Back to top |
|
 |
|