JMS MessageConsumer messageListener does push or pull?

What really happens under the hood when I install a MessageListener in my MessageConsumer queue object. Does the MessageConsumer object create some kind of poll on stage or is this a real push made by the JMS server?

Java Messaging Service (O'Reilly Java Series) by David A. Chappell, Richard Monson-Höfel, and Mark Richards, p10 CHAPTER 1: Point-to-Point

The point-to-point messaging model has traditionally been a pull-based or poll-based model where messages are requested from a queue rather than automatically pushed to a client.

http://docs.oracle.com/javaee/1.4/tutorial/doc/JMS4.html#wp79175

When message delivery begins, the JMS provider automatically calls the message receiver using the Message method whenever a message is sent.

Thanks Kod

+5
source share
1 answer

These two do not contradict each other. P2P is essentially pull-based, since responsibility for a reader message must be obtained after sending by the manufacturer. onMessage (), which you mentioned in your second quote, is the notification mechanism used to trigger pull. These variations are also called synchronous or asynchronous JMS message reception modes, for example, in this chapter in the Java tutorial .

+1
source

All Articles