Apache Pulsar provides a suite of command-line interface (CLI) tools that can be accessed from the bin/
directory after downloading and extracting the Pulsar distribution. These tools offer a range of capabilities, including starting and stopping Pulsar, managing tenants, namespace, & topics, and doing other operations such as benchmarking. To learn how to use each tool, simply run it with no argument or use the --help
argument for detailed instructions.
Most of the Pulsar client CLI tools use a configuration file client.conf
stored in the conf/
directory to connect to a Pulsar cluster. You can edit this file to specify the required information to connect to your StreamNative Cloud cluster.
You need to gather the following information for your StreamNative Cloud cluster:
Sign in to your StreamNative Cloud account.
In the Cloud Console, navigate to the cluster you want to connect to.
In the Cluster Dashboard page, select the Details tab.
Copy the HTTP Service URL (TLS) value and paste it into the webServiceUrl
property in the client.conf
file.
Copy the Broker Service URL (TLS) value and paste it into the brokerServiceUrl
property in the client.conf
file.
Follow the instructions in Create an API key to create an API key and copy the API Key value.
Add the following value token:<api-key>
to the authParams
property in the client.conf
file. <api-key>
is the value you copied in the previous step.
Update the authPlugin
property in the client.conf
file to org.apache.pulsar.client.impl.auth.AuthenticationToken
.
You can use the pulsar-admin
tool to run admin operations on your StreamNative Cloud cluster. For example, you can use the following command to list all the available tenants in your cluster:
Please make sure the service account has the necessary permissions to run the command.
You can use the pulsar-client
tool to produce messages to a Pulsar topic. For example, you can use the following command to produce 10 messages to a topic named my-topic
:
You should see the following output at the end of the command:
You can use the pulsar-client
tool to consume messages from a Pulsar topic. For example, you can use the following command to consume 10 messages from a topic named my-topic
:
You should see a similar output to the following:
Apache Pulsar provides a suite of command-line interface (CLI) tools that can be accessed from the bin/
directory after downloading and extracting the Pulsar distribution. These tools offer a range of capabilities, including starting and stopping Pulsar, managing tenants, namespace, & topics, and doing other operations such as benchmarking. To learn how to use each tool, simply run it with no argument or use the --help
argument for detailed instructions.
Most of the Pulsar client CLI tools use a configuration file client.conf
stored in the conf/
directory to connect to a Pulsar cluster. You can edit this file to specify the required information to connect to your StreamNative Cloud cluster.
You need to gather the following information for your StreamNative Cloud cluster:
Sign in to your StreamNative Cloud account.
In the Cloud Console, navigate to the cluster you want to connect to.
In the Cluster Dashboard page, select the Details tab.
Copy the HTTP Service URL (TLS) value and paste it into the webServiceUrl
property in the client.conf
file.
Copy the Broker Service URL (TLS) value and paste it into the brokerServiceUrl
property in the client.conf
file.
Follow the instructions in Create an API key to create an API key and copy the API Key value.
Add the following value token:<api-key>
to the authParams
property in the client.conf
file. <api-key>
is the value you copied in the previous step.
Update the authPlugin
property in the client.conf
file to org.apache.pulsar.client.impl.auth.AuthenticationToken
.
You can use the pulsar-admin
tool to run admin operations on your StreamNative Cloud cluster. For example, you can use the following command to list all the available tenants in your cluster:
Please make sure the service account has the necessary permissions to run the command.
You can use the pulsar-client
tool to produce messages to a Pulsar topic. For example, you can use the following command to produce 10 messages to a topic named my-topic
:
You should see the following output at the end of the command:
You can use the pulsar-client
tool to consume messages from a Pulsar topic. For example, you can use the following command to consume 10 messages from a topic named my-topic
:
You should see a similar output to the following: