A message consumer can support either synchronous or asynchronous consumption of messages.
Synchronous consumption means the consumer explicitly requests that a message be delivered and then consumes it.
Depending on the method used to request messages, a synchronous consumer can choose to wait (indefinitely) until a message arrives, to wait a specified amount of time for a message, or to return immediately if there is no message ready to be consumed. (“Consumed” means the object is immediately available to the client. Messages that were successfully sent but which the broker has not finished processing are not ready to be consumed.)
Asynchronous consumption means that the message is automatically delivered to a message listener object (MessageListener) that has been registered for the consumer. The client consumes the message when a session thread invokes the onMessage() method of the message listener object.