The producer is called a sender and the consumer is called a receiver.
msg exchanged via virtual channel - queue
each msg only delievered to only one receiver
msgs are ordered
no coupling of the producers to the consumers
multiple consumers using same queue:
How messages sent to a queue are distributed to the queue’s consumers depends on the policies of the JMS provider. Some JMS providers use load-balancing
2 types of p2p:
fire and forget : logging, kick-off report, trigger event on another process
async request/reply (blocking waiting for reply on reply queue)
point-to-point guarantees that only one consumer will process a given message.
Another advantage is that the point-to-point model provides a QueueBrowser that allows the JMS client to take a snapshot of the queue to see messages waiting to be consumed
Message correlation is required when using the request/reply model of point-to-point messaging where the queue is being shared by multiple producers and consumers
QueueReceiver using filter (correlationID equals to original msgID)
Dynamic queues are queues that are created through the application source code using a vendor-specific API. Administered queues are queues that are defined in the JMS provider configuration files or administration tools.
Load Balancing Using Multiple Receivers
The JMS specification states that this capability must be implemented by a JMS provider, although it does not define the rules for how the messages are distributed among consumers.
Start another QLender·: java -cp javax.jms_1.1.1.jar:activemq-all-5.15.5.jar:. QLender QueueCF LoanRequestQ
Examining a Queue
Messages obtained from a QueueBrowser are copies of messages contained in the queue and are not considered to be consumed—they are merely for browsing.
It is also important to note that the QueueBrowser is not guaranteed to have a definitive list of messages in the queue: The contents of the queue may change between the time the browser is created and the time you examine its contents.
UseCase
Point-to-point is used when you want one receiver to process any given message once and only once - point-to-point guarantees that only one consumer will process a given message.