Point-to-Point (PTP)

When the destination is a queue, the messaging mode is said to be point-to-point, PTP or P2P, where it is possible to have one or more producers or senders but only one consumer (receiver).

In other words, the possible sender-receiver configurations in this mode are one-to-one and many-to-one. In the PTP mode, the receiver might or might not be active at the time the message is sent. The messaging provider will store the message until the intended consumer has retrieved the message or until the message expires. An important characteristic of this mode is that the consumer always acknowledges the successful processing of a message.

As designed, the JMS API classes are clearly grouped around messaging modes (PTP or Pub/Sub), which makes for easier programming and understanding of the model.

For example, if we know that the destination is a queue, the corresponding QueueConnectionFactory, QueueConnection, QueueSession, QueueSender and QueueReceiver classes must be available to perform messaging operations (send and receive) for the queue destination.