Mahazen Logo
Loslegen
blog.backToBlog
Enterprise Integration

Message Channels Explained: Point-to-Point vs Publish-Subscribe

8. März 2026
Message Channels Explained: Point-to-Point vs Publish-Subscribe

The choice between Point-to-Point and Publish-Subscribe channels is one of the most consequential decisions in an integration architecture. Here is how to make the right call.

The Two Fundamental Channel Types

Every messaging system provides at least two channel types. Understanding the difference — and more importantly, when to use each — is the first building block of a solid integration architecture.

Point-to-Point Channel

A Point-to-Point (P2P) channel guarantees that exactly one consumer processes each message. Even if multiple consumers are listening on the channel, only one receives any given message. This is the basis of competing consumers — a horizontal scaling pattern where you add more workers to increase throughput.

Use Point-to-Point when:

  • Exactly one system should act on each message (e.g. process a payment, send a single email)
  • You want to scale consumers independently of producers
  • The work is idempotent and you want at-least-once delivery semantics

In Apache Camel, a P2P channel maps directly to a JMS Queue or a Kafka topic with a single consumer group:

from("jms:queue:orders.new")
  .to("bean:orderProcessor");

Publish-Subscribe Channel

A Publish-Subscribe (Pub-Sub) channel delivers each message to all subscribers. The producer does not need to know who is listening — it simply publishes. Each subscriber maintains its own independent copy of the message stream.

Use Publish-Subscribe when:

  • Multiple systems need to react to the same event (e.g. an order created event triggers inventory, billing, and notification services simultaneously)
  • You want loose coupling — adding a new subscriber should not require changes to the producer
  • Fan-out behaviour is correct by design
// Producer publishes once
from("direct:order-created")
  .to("jms:topic:orders.events");

// Each subscriber has its own route
from("jms:topic:orders.events?clientId=inventory&durableSubscriptionName=inventory-sub")
  .to("bean:inventoryService");

from("jms:topic:orders.events?clientId=billing&durableSubscriptionName=billing-sub")
  .to("bean:billingService");

The Dead Letter Channel

Both channel types need a safety net: the Dead Letter Channel. When a message cannot be processed after a configurable number of retries, it is moved to a dead letter queue rather than being discarded. This preserves the message for investigation and reprocessing, and prevents a poison message from blocking the entire channel.

errorHandler(deadLetterChannel("jms:queue:orders.dead-letter")
  .maximumRedeliveries(3)
  .redeliveryDelay(2000)
  .backOffMultiplier(2)
  .useExponentialBackOff());

Guaranteed Delivery

Both channel types can be made durable — messages persist to disk and survive broker restarts. In JMS this is DeliveryMode.PERSISTENT. In Kafka, durability comes from replication factor and acks=all. Guaranteed Delivery is non-negotiable in financial or order processing contexts where losing a message means losing a transaction.

Choosing in Practice

A common pattern in enterprise systems is to combine both: a producer publishes to a topic (Pub-Sub), and each subscriber reads from its own queue that fans out from that topic. This gives you the loose coupling of Pub-Sub with the at-most-once processing guarantee of P2P. In AWS this is SNS → SQS fanout; in Kafka it is a topic with multiple consumer groups.

Enterprise Integration Messaging EIP