As discussed, Java messaging service has defined the following two modes of operation for exchanging messages:
- Point-to-Point messaging
- Publish-Subscribe messaging
In the point-to-point messaging model, a sender sends the message over a messaging service provider and a consumer consumes the message. In this model, we use a queue as a messaging service provider. In the publish-subscribe model, a publisher publishes the message and the subscribers will receive the messages. In this model, we use a topic as a messaging service provider.
In this section, we will demonstrate these two models and discuss some of the messaging types that can be used in these programming models.