Asynchronicity and Synchronicity in ESBs
Advantages of using synchronous behaviour in an ESB (such as SOAP over HTTP):
-
You want your clients to be simple to write - with asynchronous behaviour, when a reply comes back to a client, it needs to know how to correlate that with the request it sent out (this is one reason JMS has the concept of message and correlation IDs). This probably requires it to keep some state hanging around. This isn’t necessary with synchronous behaviour, as the client thread blocks waiting for the reply.
-
You want your system to be fast (in the general case). In general, you would expect synchronous behaviour to incur less overhead.
Advantages of using asynchronous behaviour in an ESB (such as JMS):
-
You want to ‘send and forget’. Asynchronous generally makes more sense for one-way operations than synchronous behaviour, for this reason.
-
You want the system to scale more cleanly when there are lots of outstanding requests from various clients.
The above observations are drawn from work with WebSphere ESB, although the general principles probably apply elsewhere.