- StreamNative Cloud
- Use
Work with topics
A topic is a named channel used to deliver messages published by producers to consumers. After creating a namespace, you can create one or more topics for the namespace. It's recommended to have at least one partition per topic so that you can add more partitions in the future. If there are zero partitions (a non-partitioned topic), you will not be able add more partitions to the topic after it is created.
Work with topics through snctl
In this release, snctl does not support creating topics. You can create a topic for the organization through StreamNative Cloud Console. For details about how to create a topic, see create topic. You can use pulsarctl to manage topics.
Work with topics through StreamNative Cloud Console
This section describes how to work with topics through the StreamNative Cloud Console.
Create a topic
To create a topic, follow these steps.
On the left navigation pane, under Resources, click Topics.
Click New Topic.
Configure the topic, as outlined in the following table.
Item Description Domain Configure the type of the topic.
- Persistent: messages in a persistent topic are durably persisted on the storage disk.
- Non-persistent: messages in a non-persistent topic are not persisted on the storage disk.
By default, it is set to Persistent.Topic Name Enter a name for the topic. It is a string of up to 40 characters, supporting lowercase letters (a-z), numeric characters (0-9), and the special character hyphen (-). Partitions (Optional) configure the number of partitions for a partitioned topic. You can have from 1 up to 100 partitions per topic. It's recommended to have at least 1 partition. Click Confirm.
(Optional) Click New Topic to add more topics for the namespace.
Manage topics
This section describes how to manage topics through the StreamNative Cloud Console.
Perform basic operations for topics
You can view detailed information about the target topic, unload, terminate, compact, and offload topics, as well as configure the subscription name of the topics.
To perform basic operations for a topic, follow these steps.
On the left navigation pane, under Resources, click Topics.
Click the topic name link to display detailed information about that topic.
If the topic is partitioned, click the partition link of the selected topic.
Select the OVERVIEW tab.
On the OVERVIEW tab, you can perform the following operations.
- Unload the topic: click Unload to unload the topic.
- Terminate the topic: click Terminate to terminate the topic.
- Compact the topic: click Compact to compact the topic.
- Configure the subscription name of the topic: click New Subscription and a dialog box displays. Enter a name for the subscription and then click Confirm. Thereafter, the StreamNative Cloud Console can manage topics based on the subscription name.
- Check detailed information about the topic.
The following table outlines detailed information about the topic.
Item Description Info In Rate The ingress rate of the topic. Out Rate The egress rate of the topic. In Throughput The ingress throughput of the topic. Out Throughput The egress throughput of the topic. Producers Producer Id The producer ID of the topic. Producer Name The producer name of the topic. In Rate The ingress rate of the topic. In Throughput The ingress throughput of the topic. Avg Msg Size The average message size of the topic. Address The address of the topic. Since When the producer is created. Subscriptions Subscription Name The subscription name of the topic. Type The subscription type of the topic. Currently, the StreamNative Cloud Console does not support configuring the subscription type for a topic. You can configure the subscription type through Pulsar manager. Out Rate The egress rate of the topic. Out Throughput The egress throughput of the topic. Msg Expired The expired messages for the topic. Backlog Configure the backlog for the subscription.
- SKIP: skip some messages for the subscription.
- EXPIRE: expire messages that are older than the given expiry time (in seconds) for the subscription.
- CLEAR: clear the backlog for the subscription.
- RESET BY ID: reset the ID of the message at which the subscription is created.
- RESET BY TIME: reset the time when the subscription is created.
- PEEK: peek some messages for the subscription.
- UNSUBSCRIBE: delete the subscription.
Create schema for topics
Currently, only Avro and JSON schema are supported.
To configure schema for topics, follow these steps.
On the left navigation pane, under Resources, click Topics.
Click the topic name link.
If the topic is partitioned, click the partition link of the selected topic.
Select the Schema tab. The Create a Pulsar schema page displays.
Select a schema type from the Schema Type drop-down list.
Configure the key and the value and then click Confirm.
Check messages
On the left navigation pane, under Resources, click Topics.
Click the link of the topic name to display detailed information about the topic.
If the topic is partitioned, click the partition link of the selected topic.
Select the Messages tab and check information about messages in this topic.
Item Description Subscription Name The subscription name of the topic. Type The subscription type of the topic. Currently, the StreamNative Cloud Console does not support configuring the subscription type for a topic. You can configure the subscription type through Pulsar manager. Out Rate The egress rate of the topic. Out Throughput The egress throughput of the topic. Msg Expired The expired messages for the topic. PEEK The messages peeked for the subscription.
- message ID: the IDs of the peeked messages.
- Message: the peeked messages.
Check storage
On the left navigation pane, under Resources, click Topics.
Click the link of the topic name.
If the topic is partitioned, click the partition link of the selected topic.
Select the Storage tab and check storage information for this topic.
Item Description Storage size The storage size. Entries The entries. Segments The segments. Ledgers Ledger Id The ledger ID Entries The total number of entries that belong to the ledger. Size The size of messages written to the ledger (in bytes). Status The state of the ledger for writing messages. If it is set to Opening
, the ledger is open for saving published messages.Offload Whether the ledger can be offloaded or not. Cursors Cursor The cursor ID. Mark Delete Position All messages before the markDeletePosition
are acknowledged by the subscriber.Read Position The latest position for the subscriber to read messages. Waiting Read Op It is set to True
when the subscription has read the latest message published to the topic and is waiting for new messages to be published.Pending Read Op The number of read requests to the BookKeepers in progress. Entries Since First Not AckedMessage Entries that are not acknowledged.
Configure policies for topics
To configure policies for topics, follow these steps.
On the left navigation pane, under Resources, click Topics.
Click the link of the topic name.
If the topic is partitioned, click the partition link of the selected topic.
Select the POLICIES tab and configure authorization policies for the topic.
Item Description Authorization Grant/Revoke permissions to other client roles.
- consume: grant/revoke the consuming action.
- produce: grant/revoke the producing action.
- functions: grant/revoke the Pulsar functions action.(Optional) click Add Role to add more permissions for the topic.
Delete topics
To delete a topic, follow these steps.
On the left navigation pane, under Resources, click Topics.
Click the link of the topic name.
If the topic is partitioned, click the partition link of the selected topic.
Select the Policies tab and then click Delete Topic.
A dialog box displays asking, Are you sure you want to delete this?
Enter the topic name and then click Confirm.