-
Notifications
You must be signed in to change notification settings - Fork 73
DataStax Astra Streaming
Follow these steps to use a Pulsar service from DataStax Astra Streaming service.
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.
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.
-
<service-url>
- copy"Broker Service URL"
(eg.pulsar+ssl://pulsar-foo.streaming.datastax.com:6651
) -
<admin service-url>
- copy"Web Service URL"
(eg.https://pulsar-foo.streaming.datastax.com
)
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.
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>
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 .
|