7.4.1 PTP messaging model

The PTP messaging model sends and receives messages using the Point-to-Point method.

Organization of this subsection
(1) Sending and receiving messages using the PTP messaging model
(2) Features of the PTP messaging model

(1) Sending and receiving messages using the PTP messaging model

With the PTP messaging model, the sending client (producer) that creates and sends messages is called the sender. Also, the client that receives the messages (consumer) is called the receiver.

The messages sent from the sender are registered in a destination called the queue. When the receiver receives a message stored in the queue, the message is deleted from the queue.

The following figure shows the flow of messages in the PTP messaging model.

Figure 7-5 Flow of messages in the PTP messaging model

[Figure]

The messages are sent from the sender and registered in a queue. The messages registered in the queue are delivered to one of the receivers running at that time (message1 and message2). The messages delivered to the receiver are deleted from the queue. If the delivery destination receiver does not exist, the messages accumulate in the queue (message3).

Note that you can use the queue browser provided in the JMS specifications to check the status of the queue in which the messages are registered. For details on the queue browser, see the JMS specifications.

(2) Features of the PTP messaging model

The features of the PTP messaging model are as follows:

Features from the sending of a message to the execution of processing
This point describes the features from the sending of a message to the execution of processing with the PTP messaging model.
  • One or multiple senders can send messages to the queue.
  • The receiver receives and processes the messages regardless of the sender that sent the message.
  • One message is processed by one receiver only.
  • The senders and receivers have no dependency on the process execution timing. Even if the receiver is not running when the sender sends the message, the receiver can receive the message when the receiver starts next.
  • When multiple receivers receive messages from the same queue, each receiver executes the processing when the order of the messages is not important.
  • The messages are registered in the queue in the order in which the sender sent the messages.
  • The processing order of the messages is determined based on the validity period of the messages, the priority set for the messages, and Message Selector being used by the receiver, and the receivers are invoked according to this order.
  • If no receiver is running, the sent messages are stored in the queue.
Features of the system
  • You can dynamically add or delete the senders and receivers. Due to this, you can extend or scale-down the system according to the usage.
  • Multiple senders can share the connections used for establishing a connection with Cosminexus JMS Provider. Also, multiple receivers can share the connections managed by Cosminexus JMS Provider. For example, sender1 and sender2 can share a connection, and receiver1 and receiver2 can share a connection. For details on the connections, see 7.8.1 Connection services.