This example shows how to use the WebSocket API to connect to a Pulsar cluster and then produce and consume messages to and from the Pulsar cluster.
produce
and consume
permissions to the namespace for the target topic.9443
.Connect to the Pulsar cluster.
Replace the CLUSTER_HOST
parameter with the domain name of the cluster.
Create a consumer and use the consumer to consume messages.
Create a producer and use the producer to produce messages.
This example shows how to use the WebSocket API to connect to a Pulsar cluster and then produce and consume messages to and from the Pulsar cluster.
produce
and consume
permissions to the namespace for the target topic.9443
.Connect to the Pulsar cluster.
Replace the CLUSTER_HOST
parameter with the domain name of the cluster.
Create a consumer and use the consumer to consume messages.
Create a producer and use the producer to produce messages.