• Glossary
  • Support
  • Downloads
  • DataStax Home
Get Live Help
Expand All
Collapse All

DataStax Streaming Home

Astra Streaming Documentation

    • Getting Started
    • Developing
      • Using Pulsar binaries with Astra Streaming
      • Using curl with Astra Streaming
      • Astra CLI
      • Astra Streaming Functions
      • Starlight for Kafka
      • Starlight for RabbitMQ
      • Producing and consuming messages
        • Astra Portal
        • Pulsar Cli
        • Client Applications
          • Java
          • Python
          • C#
          • Golang
          • Node.js
      • Change data capture (CDC)
        • CDC for Astra DB
    • Operations
      • Geo-replication
      • Astra Streaming Limits
      • Astra Streaming Pricing
      • Astra Streaming Regions
      • Scrape Astra Streaming metrics with Prometheus
      • Manage Tokens
      • Enrollment FAQ
    • Guides and Examples
      • FAQs
      • Manage permissions
        • Use custom roles
      • Pulsar subscriptions
        • Exclusive
        • Shared
        • Failover
        • Key_shared
    • API Docs
      • Using the DevOps v2 API
      • API References
    • IO Connectors
    • Astra Streaming release notes
  • Astra Streaming Documentation
  • Guides and Examples
  • Pulsar subscriptions
Edit this Page

Subscriptions in Pulsar

Subscriptions in Pulsar describe which consumers are consuming data from a topic and how they want to consume that data.

Subscriptions are managed in the broker as a collection of metadata about a topic and its subscribed consumers. This metadata includes:

  • Topic name - which topic the consumer wants data from

  • Subscription name - a string representing a qualified name for the subscription

  • Subscription type - which type of subscription is 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 starting at the earliest cursor position in my-subscription to my-topic:

pulsarConsumer = pulsarClient.newConsumer(Schema.BYTES)
    .topic("my-topic")
    .subscriptionName("my-subscription")
    .subscriptionType(SubscriptionType.Shared)
    .subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
    .subscribe();

Read on to use Pulsar’s four types of subscriptions to manage your topic consumption.

  • Exclusive subscriptions

  • Shared subscriptions

  • Failover subscriptions

  • Key_shared subscriptions

What’s next?

  • Follow our simple guide to get started with Astra now.

  • For using Kafka with Astra Streaming, see Starlight for Kafka.

Use custom roles Exclusive

General Inquiries: +1 (650) 389-6000 info@datastax.com

© DataStax | Privacy policy | Terms of use

DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

Kubernetes is the registered trademark of the Linux Foundation.

landing_page landingpage