Deliver-To-One

Through the use of Solace messaging APIs, client applications can use the Deliver-To-One (DTO) feature of Solace PubSub+ to send a Direct delivery message to a single client even though there may be a number of clients with appropriate subscriptions that are capable of receiving the message.

The use of DTO allows for the load-balancing of received messages because only one connected client can consume a DTO message. It should be noted that, as a Direct message, if there are no connected clients, the event broker will not spool the message.

The DTO priority and behaviors are only relevant to messages published with the DTO flag set. Otherwise normal delivery rules apply; that is, all messages are delivered to all subscribers.

  • For new applications we recommend using Shared Subscriptions for Direct Messaging load balancing.
  • Message consumers using web messaging APIs (Javascript and Node.js) cannot change message priority to take advantage of the DTO feature.

Controlling DTO Message Reception

To control which client can receive a DTO message, subscribing clients are assigned a local subscriber priority through a session property. The subscriber priority levels range from 1 (the highest) to 4 (the lowest).

A local priority is the priority that a client’s subscriptions have for receiving DTO messages published on the event broker that the client is directly connected to.

When a DTO message is published, a single local client with the highest subscriber priority level will receive the message. In a situation where the highest local subscriber priority level is shared by multiple clients, a single client is chosen in a round-robin fashion.

When possible, a published DTO message is always delivered to a locally connected client. However, if there are no clients with assigned local subscriber priorities, the message will be delivered to a neighboring event broker if one is available. Note that no attempt is made to evenly distribute DTO messages amongst remotely-connected event brokers should there be multiple options. This implies that a network of event brokers will ensure single delivery of DTO messages amongst the appropriate clients connected to a network of event brokers. However, load balancing can only be expected amongst clients connected to the same event broker.

DTO & Deliver Always (DA)

Clients can also override DTO delivery for specific topic subscriptions by applying the Deliver Always (DA) property to those subscriptions when they are added to the event broker. Topic subscriptions with the DA flag always receive all messages with topics that match the subscription—regardless of set priorities. Using the DA flag override can be useful if an application wants to take a copy of the message for auditing, replaying, or monitoring purposes. For example, a monitoring application should use the DA flag for every subscription it has so that it does not accidentally become a member of a DTO group and receive messages that should be delivered to other applications relying on DTO.

As a special case, the subscription > (which matches all topics) is always treated as a DA subscription.

Subscriptions (with priority 1 to 4) and DA subscriptions that happen to share the same topic string are unique, meaning that a client may have both a DTO and DA subscription to the same topic. However, should a client be eligible to receive a given message due to both priority and DA subscriptions only a single copy of the message will be delivered.

How to Show a Subscription's DTO Priority

The DTO priority of a subscription is shown by the show smrp subscriptions User EXEC command as either a value of P1 to P4 or the value DA to indicate a Deliver Always subscription.