- Manage StreamNative Clusters
- Configure Clusters
Configure Protocols
This topic describes how to enable, disable, and configure different messaging and data streaming protocols for your cluster. For general guidance on configuring your cluster, see Cluster Configuration Overview.
The following protocols are available for configuration:
- Kafka Protocol
- AMQP (Advanced Message Queuing Protocol)
- MQTT (Message Queuing Telemetry Transport)
- WebSocket
Making changes to the protocols configuration results in restarting the Pulsar brokers in your cluster. Please plan these changes accordingly to avoid disruption to your business applications.
Kafka Protocol
Kafka protocol support allows Kafka clients to interact with your Pulsar cluster. This enables seamless integration for applications already using Kafka.
To enable and configure the Kafka protocol for your Pulsar cluster, you can use the config
section in your PulsarCluster specification. Here's how to do it:
- In your PulsarCluster specification, locate or add the
config
section. - Within the
config
section, add aprotocols
field. - In the
protocols
field, add akafka
object to configure Kafka-specific settings.
Here's how you can configure Kafka protocol support:
Using
snctl
:apiVersion: cloud.streamnative.io/v1alpha1 kind: PulsarCluster metadata: name: my-cluster spec: config: protocols: kafka: {}
Using Terraform:
resource "streamnative_cluster" "my_cluster" { # ... other configuration ... config { protocols { kafka = { enabled = "true" } } } }
Important: If you try to disable the Kafka protocol in your cluster after you have enabled it, you will disrupt the existing Kafka clients connected to your cluster and cause data corruption.
AMQP (Advanced Message Queuing Protocol)
Note
AMQP protocol support is currently in Private Preview and is only available to select users. If you're interested in trying out this feature, please contact StreamNative support for more information.
AMQP support allows AMQP-compliant clients to connect to your Pulsar cluster. This is useful for applications that require AMQP compatibility.
To enable and configure the AMQP protocol for your Pulsar cluster, you can use the config
section in your PulsarCluster specification. Here's how to do it:
- In your PulsarCluster specification, locate or add the
config
section. - Within the
config
section, add aprotocols
field. - In the
protocols
field, add aamqp
object to configure AMQP-specific settings.
Here's how you can configure AMQP protocol support:
Using
snctl
:apiVersion: cloud.streamnative.io/v1alpha1 kind: PulsarCluster metadata: name: my-cluster spec: config: protocols: amqp: {}
Using Terraform:
resource "streamnative_cluster" "my_cluster" { # ... other configuration ... config { protocols { amqp = { enabled = "true" } } } }
Important: If you try to disable the AMQP protocol in your cluster after you have enabled it, you will disrupt the existing AMQP clients connected to your cluster and cause data corruption.
MQTT (Message Queuing Telemetry Transport)
MQTT support enables IoT devices and applications using the MQTT protocol to communicate with your Pulsar cluster. This is particularly useful for IoT and mobile scenarios.
To enable and configure the MQTT protocol for your Pulsar cluster, you can use the config
section in your PulsarCluster specification. Here's how to do it:
- In your PulsarCluster specification, locate or add the
config
section. - Within the
config
section, add aprotocols
field. - In the
protocols
field, add amqtt
object to configure MQTT-specific settings.
Here's how you can configure MQTT protocol support:
Using
snctl
:apiVersion: cloud.streamnative.io/v1alpha1 kind: PulsarCluster metadata: name: my-cluster spec: config: protocols: mqtt: {}
Using Terraform:
resource "streamnative_cluster" "my_cluster" { # ... other configuration ... config { protocols { mqtt = { enabled = "true" } } } }
Important: If you try to disable the MQTT protocol in your cluster after you have enabled it, you will disrupt the existing MQTT clients connected to your cluster and cause data corruption.
WebSocket
Pulsar WebSocket support enables real-time, bidirectional communication between clients and your Pulsar cluster via WebSocket. This feature can be enabled or disabled based on your requirements.
To enable WebSocket for your cluster, you can set the config.websocketEnabled
field in your PulsarCluster specification to true
if you are using snctl
or config.websocket_enabled
field in your PulsarCluster specification to true
if you are using Terraform.
Please note that if you disable WebSocket, you will not be able to create new WebSocket clients in the cluster. Existing WebSocket clients will be disconnected.