One-to-One Communication

One-to-one communication lets a publisher send a message to one specific subscriber.

In the one-to-many publishing model, a publisher produces a stream of messages, and every subscriber to that stream can receive every message in the stream. However, sometimes a publisher needs to direct messages to a specific subscriber, even though many subscribers share the transport. Such situations require a different publishing model: one-to-one communication.

One-to-One Communication, Sending to an Inbox

In one-to-one communication, a publisher sends a message to a specific inbox subscriber: only that inbox subscriber receives the message. One-to-one communication can use the same transports as one-to-many communication.

In the preceding diagram, the program Pub sends a message stream over transport T1 (red). The programs Sub1 and Sub2 both receive that message stream, as one would expect with one-to-many publishing. Notice that the same transport, T1, also carries one-to-one messages (orange dashed line) to an inbox within Sub1, but Sub2 does not receive these one-to-one messages. Sub2 can have its own inbox, and Pub can send to it, but neither inbox receives messages directed to the other.