Skip to content

DataStax Astra Streaming

Chris Bono edited this page Dec 3, 2022 · 3 revisions

Follow these steps to use a Pulsar service from DataStax Astra Streaming service.

Pre-requisites

Follow the first few steps from the Astra Streaming Quickstart to create an account, tenant, and namespace. You may want to allow your namespace to auto-create topics if your application is expecting this ability.

Steps

Obtain the required configuration property values


Tip
From the pre-requisites you will receive a link to your personal Astra Streaming Dashboard, this is what the steps below are referring to.

Navigate to your Astra Streaming Dashboard and select the desired tenant. Find the "Tenant Details" section.


Navigate to Tenant / Settings / Token Management in your Astra Streaming Dashboard and find the row of the token you will use to connect to the cluster with.

  • <token> - click the "Copy" icon to copy the token.

Use the required configuration property values

Add the following to your application.yml (or other property source):

spring:
  pulsar:
    client:
      auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationToken
      authentication:
        token: <token>
      service-url: <service-url>
    administration:
      auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationToken
      authentication:
        token: <token>
      service-url: <admin service-url>

Run your application

Launch your application and you should be on your way to Happy Streaming!

Tip
If you encounter errors on application startup with status 401 it is likely the token you are connecting with does not have access to the tenant/namespace your topic is in. Try fully-qualifying your topic names such as persistent://my-tenant/my-namespace/my-topic.