Astra Streaming quickstart
Astra Streaming is a serverless data streaming and event stream processing service integrated in the Astra Portal and powered by Apache Pulsar™. Using Astra Streaming, you can create Pulsar instances, manage streaming clusters, scale across cloud regions, and manage Pulsar resources such as topics, connectors, functions and subscriptions.
This quickstart demonstrates how to create and use a streaming tenant running Apache Pulsar.
Prerequisites
-
Sign in or create an Astra DB account.
Create a streaming tenant
A Astra Streaming tenant is a portion of DataStax-managed Apache Pulsar that is only yours. Within tenants, you create namespaces, topics, functions, and more. To learn more about the concept of tenancy, see the Pulsar documentation.
You can create a tenant in the Astra Portal or programmatically. For this quickstart, use the Astra Portal.
-
In the Astra Portal navigation menu, click Streaming.
-
Click Create a Tenant.
-
Name your streaming tenant something memorable like
my-stream-RANDOM_UUID
. All tenant names in Astra Streaming must be unique.RANDOM_UUID
can be any string of letters and numbers, as long as it is unique. -
Choose your preferred cloud provider and region. For this example tenant, the region doesn’t really matter.
-
Click Create Tenant. You are directed to the quickstart page for your new tenant.
Create a namespace in your tenant
Namespaces are logical groupings, such as environments or applications, for message topics within tenants.
Astra Streaming automatically creates a default
namespaces when you create a tenant.
You can use the default namespace or create other namespaces.
Tenants usually have many namespaces.
To learn more about namespaces, see the Pulsar documentation.
You can create namespaces in the Astra Portal or programmatically. For this quickstart, use the Astra Portal. For information about the Pulsar CLI or APIs, see Use Pulsar binaries with Astra Streaming and Form Astra Streaming HTTP requests.
-
In the Astra Portal navigation menu, click Streaming, and then select your tenant.
-
Click the Namespace And Topics tab, and then click Create Namespace.
-
Enter a namespace name, and then click Create.
-
Click "Create" to create the namespace.
Create a topic
Topics are the core construct of a messaging system. Topics provide a way to group messages matching certain criteria.
The name of the topic usually broadly defines the criteria. You can also apply more advanced characteristics, like schemas, at the topic level.
Topics are where other applications or services can "listen" for new messages. Consumers subscribe to topics to receive messages, and functions and connectors can listen for messages to trigger automated workflows.
In Pulsar, topic addresses are formatted like URLs, such as persistent://tenant/namespace/topic
.
To learn more about topics, see the Pulsar documentation.
As in the previous steps, you can create topics in the Astra Portal or programmatically.
-
In the Astra Portal navigation menu, click Streaming, and then select your tenant.
-
Click the Namespace And Topics tab.
-
Locate a namespace where you want to create a topic, and then click Add Topic.
-
Enter a topic name, and then click Add Topic.
Topic names must start with a lowercase letter, and they can contain only letters, numbers, and hyphens (
-
).Disregard the Persistent and Partitioned options for now.
Next steps
Your new topic is ready to produce and consume messages. There are several different ways to do this:
-
Astra Portal: Use Astra Streaming’s "Try Me" feature in the Astra Portal.
-
Pulsar Client: Use the Pulsar CLI to interact with the topic.
-
Runtime Clients: Create a client application that interacts with Pulsar.