Subscriptions in Apache Pulsar™
|
Effective October 9, 2026, Astra Streaming subscriptions are discontinued and the service is considered deprecated. For existing subscriptions, access to the service remains available for the duration of your subscription. For more information, see the Astra Streaming discontinuation announcement, contact your account representative, or contact IBM Support. |
Subscriptions in Apache Pulsar™ describe which consumers are consuming data from a topic and how they want to consume that data.
Subscription metadata
Subscriptions are managed in the broker as a collection of metadata about a topic and its subscribed consumers. This metadata includes:
-
Topic name: The topic the consumer wants data from
-
Subscription name: A string representing a qualified name for the subscription
-
Subscription type: The type of subscription being used
-
Subscription cursor: A representation of the consumer’s current place in the subscribed topic log
For example, the Pulsar consumer below has a Shared subscription to my-topic that starts at the Earliest cursor position in my-subscription:
pulsarConsumer = pulsarClient.newConsumer(Schema.BYTES)
.topic("my-topic")
.subscriptionName("my-subscription")
.subscriptionType(SubscriptionType.Shared)
.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
.subscribe();