Subscribers and Subscriptions

A subscriber is an application that requests information about a specific topic in a publish/subscribe network. A subscriber receives messages, about the same or different topics, from more than one publisher. A subscription is a request that is sent by the subscriber to receive messages from a relevant topic.

You can use six types of subscription in Eclipse Amlen:

Unshared non-durable subscriptions

This is a subscription type where each subscriber application receives a copy of every message that is published on a relevant topic. However, the subscription exists only while the subscriber is active. Any messages that are sent to the topic are added to the subscription only while the subscriber application remains connected to the Eclipse Amlen server. The subscription is not persisted and is deleted (together with any undelivered messages that are associated with it) when the subscriber is closed. This type of subscription does not have a subscription name.

You can use unshared non-durable subscriptions with MQTT and JMS.
Unshared durable subscriptions

This is a subscription type where each subscriber application receives a copy of every message that is published on a relevant topic. The subscriber application receives the messages that are published when the subscriber application is not connected. All messages from the publishers on that topic are retained until the messages are delivered to, and acknowledged by, a subscriber on the durable subscription or until a subscriber ends the subscription by unsubscribing. This continued receipt of messages can lead to a build-up of messages on the subscriber queue if the subscriber application is not connected.

You can use unshared durable subscriptions with MQTT and JMS. To make a subscription durable in MQTT, set cleanSession=0.
Private-shared non-durable subscriptions

This is a subscription type where the work of receiving messages from a non-durable topic subscription is shared between multiple subscribers within the same connection. Each message from the subscription is delivered to only one of the subscribers on that subscription. Any shared non-durable subscription exists only while there are active subscribers on the subscription. The subscription is not persisted and is deleted, along with any undelivered messages that are associated with that subscription, when the last subscriber is closed. When all subscribers are closed, the subscription is closed.

A private-shared subscription is only shared within one client ID. Therefore, only a topic messaging policy is required to grant authority to subscribe to the topic.

You can use private-shared non-durable subscriptions with JMS.
Private-shared durable subscriptions

This is a subscription type where the work of receiving messages from a durable topic subscription is shared between multiple subscribers within the same connection. Each message from the subscription is delivered to only one of the subscribers on that subscription. The subscription is persisted and continues to accumulate messages until the subscription is explicitly closed by unsubscribing.

A private-shared subscription is only shared within one client ID. Therefore, only a topic messaging policy is required to grant authority to subscribe to the topic.

You can use private-shared durable subscriptions with JMS.
Global-shared non-durable subscriptions

This is a subscription type where the work of receiving messages from a non-durable topic subscription is shared between multiple subscribers. JMS subscribers do not specify a client ID. Each message from the subscription is delivered to only one of the subscribers on that subscription. Any shared non-durable subscription exists only while there are active subscribers on the subscription. The subscription is not persisted and is deleted, along with any undelivered messages that are associated with that subscription, when the last subscriber is closed.

JMS clients end their use of a global-shared non-durable subscription by closing their consumers. MQTT clients end their use of a global-shared non-durable subscription by issuing an MQTT UNSUBSCRIBE request, or by disconnecting. For global-shared non-durable subscriptions, although the subscription is shared by multiple clients, it exists only while at least one subscriber is active. Therefore, only the topic messaging policy is required to grant authority to subscribe to the topic.

You can use global-shared non-durable subscriptions with JMS and MQTT. However, do not allow clients that use different protocols to share global-shared subscriptions.

Use administrative subscriptions to ensure that a subscription persists when there are no clients with an interest in that subscription. For more information about administrative subscriptions, see Configuring administration subscriptions

Global-shared durable subscriptions

This is a subscription type where the work of receiving messages from a durable topic subscription is shared between multiple subscribers. JMS subscribers do not specify a client ID. Each message from the subscription is delivered to only one of the subscribers on that subscription.

Global-shared durable subscriptions require two messaging policies:
  • A topic messaging policy to authorize clients to subscribe to the topic.
  • A subscription messaging policy to authorize clients to use the global-shared durable subscription.
The subscription is persisted and continues to accumulate messages until the subscription is explicitly (in JMS) or implicitly (in MQTT) closed by unsubscribing or is deleted by a system administrator. However, a global-shared durable subscription cannot be deleted in either of the following situations:
  • Active consumers are using it.
  • Messages are currently being processed or acknowledged by JMS or MQTT sessions that are using the subscription.
System administrators can delete global-shared durable subscriptions by using the Monitoring page in the Amlen WebUI, or the REST API DELETE method with the following Eclipse Amlen URI:
http://<admin-endpoint-IP:Port>/ima/v1/service/Subscription/<clientID>/<SubName>
where
clientID
Specifies the client ID associated with the subscription that you want to delete.
SubName
Specifies the name of the durable subscription that you want to delete.
You can use global-shared durable subscriptions with JMS and MQTT. However, do not allow clients that use different protocols to share global-shared subscriptions. To make a subscription durable in MQTT, set cleanSession to 0.

Use administrative subscriptions to ensure that a subscription persists when there are no clients with an interest in that subscription. For more information about administrative subscriptions, see Configuring administration subscriptions

The following table summarizes the characteristics of the subscription types in Eclipse Amlen.

Table 1. Summary of the characteristics of the subscription types in Eclipse Amlen.

Characteristics of the subscription types in Eclipse Amlen.

Subscription type Multiple Subscribers supported? JMS clients use explicit client ID? Subscription exists and published messages are kept when no subscriber is active? Workload balancing supported? Sharing across multiple client applications supported? Messaging policy authorization required?
Unshared non-durable False Optional False False False Topic
Unshared durable False True True False False Topic
Private-shared non-durable (JMS only) True True False True False Topic
Private-shared durable (JMS only) True True True True False Topic
Global-shared non-durable True False False True True Topic
Global-shared durable True False True True True Topic and Subscription