O'Reilly logo

Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology by Greg Barish

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JMS Programming Models

To understand the applicability of queues and topics, we first need to introduce the two basic programming models that JMS supports: point-to-point (PTP) and publish/subscribe (pub/sub). Although we'll refer to these strictly as messaging models, they're also known as domains or messaging styles. The JMS specification uses these terms interchangeably.

The PTP model is designed for use between a single producer and a single consumer. Messages are added to a queue, to be retrieved by the consumer. In short, only two parties are involved in PTP communication.

In contrast, the pub/sub model is based on the notion of a topic. Publishers create topics and send out messages corresponding to them. Consumers are one or more subscribers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required