Objective 9.2: List benefits of synchronous and asynchronous messaging

Asynchronous v Synchronous
Synchronous

A subscriber or a receiver explicitly fetches the message from the destination by calling the receive method. The receive method can block until a message arrives or can time out if a message does not arrive within a specified time limit.

Asynchronous

A client can register a message listener with a consumer. A message listener is similar to an event listener. Whenever a message arrives at the destination, the JMS provider delivers the message by calling the listener's onMessage method, which acts on the contents of the message.

When you think about it the messaging is in fact two separate synchronous process; one to send a message from a publisher/sender to a queue/topic; and one to receive from a queue/topic. They can be combined to be both synchronous and asynchronous.

Hall of fame

  • Me: Part I 81%
  • Heros