A pull model lets a message consumer explicitly request a message. The request may return immediately or block the calling thread until a message becomes available. section 9.1.3
With Spring JMS, JmsTemplate provides the pull-based client. Its receive methods return a raw Message, while receiveAndConvert methods use a configured converter to produce a domain object. section 9.1.3
A consumer can request messages in several forms:
- Receive from the default destination, a Destination object, or a named destination. section 9.1.3
- Retrieve a raw JMS Message with receive, then convert it explicitly. section 9.1.3
- Retrieve an already-converted domain object with receiveAndConvert. section 9.1.3
Pulling an order from a queue
A JMS order receiver calls jms.receiveAndConvert("tacocloud.order.queue") and casts the result to TacoOrder. The receiving method controls when it is ready to process another order, rather than receiving callbacks automatically. section 9.1.3
Message receive() throws JmsException; Message receive(Destination destination) throws JmsException; Message receive(String destinationName) throws JmsException; Object receiveAndConvert() throws JmsException; Object receiveAndConvert(Destination destination) throws JmsException; Object receiveAndConvert(String destinationName) throws JmsException;
Browse the JmsTemplate receive and receiveAndConvert signatures for the available destination and conversion options. section 9.1.3



