diff --git a/modules/components/nav.adoc b/modules/components/nav.adoc index f6321ba..835f0f3 100644 --- a/modules/components/nav.adoc +++ b/modules/components/nav.adoc @@ -5,4 +5,5 @@ ** xref:heartbeat-vm.adoc[] ** xref:pulsar-beam.adoc[Pulsar Beam] ** xref:pulsar-sql.adoc[Pulsar SQL] -** xref:starlight-for-kafka.adoc[] \ No newline at end of file +** xref:starlight-for-kafka.adoc[] +** xref:starlight-for-rabbitmq.adoc[] \ No newline at end of file diff --git a/modules/components/pages/starlight-for-kafka.adoc b/modules/components/pages/starlight-for-kafka.adoc index 8efc84e..8dc02e6 100644 --- a/modules/components/pages/starlight-for-kafka.adoc +++ b/modules/components/pages/starlight-for-kafka.adoc @@ -12,7 +12,7 @@ By adding the Starlight for Kafka protocol handler to your Pulsar cluster, you c You will need the following prerequisites in place to complete this guide: * https://helm.sh/docs/intro/install/[Helm 3 CLI^]{external-link-icon} (we used version 3.8.0) -* https://www.apache.org/dyn/closer.cgi?path=/kafka/3.3.1/kafka_2.13-3.3.1.tgz[Kafka CLI^]{external-link-icon} (we used version3.3.1) +* https://www.apache.org/dyn/closer.cgi?path=/kafka/3.3.1/kafka_2.13-3.3.1.tgz[Kafka CLI^]{external-link-icon} (we used version 3.3.1) * https://kubernetes.io/docs/tasks/tools/[Kubectl CLI^]{external-link-icon} (we used version 1.23.4) * Enough access to a K8s cluster to create a namespace, deployments, and pods @@ -50,7 +50,9 @@ public/__kafka_producerid public/default ---- -Notice the namespaces prefixed with "__kafka". These are used by the service for different functions. To learn more about Starlight for Kafka operations, see the S4K xref:starlight-for-kafka:ROOT:index.adoc[documentation]. +Notice the namespaces prefixed with "__kafka". +These are used by the service for different functions. +To learn more about Starlight for Kafka operations, see the S4K xref:starlight-for-kafka:ROOT:index.adoc[documentation]. == Produce a message with the Kafka CLI @@ -86,6 +88,7 @@ Let's have a look at the topic that was created. From your Pulsar home folder, r ---- The output will include the newly created topic. + [source,shell] ---- persistent://public/default/quickstart-partition-0 diff --git a/modules/components/pages/starlight-for-rabbitmq.adoc b/modules/components/pages/starlight-for-rabbitmq.adoc new file mode 100644 index 0000000..a95e630 --- /dev/null +++ b/modules/components/pages/starlight-for-rabbitmq.adoc @@ -0,0 +1,74 @@ += Using Starlight for RabbitMQ with Luna Streaming +:navtitle: Starlight for RabbitMQ +:description: This guide will take you step-by-step through deploying DataStax Luna Streaming helm chart with the Starlight for RabbitMQ protocol handler extension +:title: A guide to deploying Luna Streaming with the Starlight for RabbitMQ extension +:helmValuesPath: https://raw.githubusercontent.com/datastaxdevs/luna-streaming-examples/main/starlight-for-rabbitmq/values.yaml + +Starlight for RabbitMQ brings native https://www.rabbitmq.com/[RabbitMQ^]{external-link-icon} protocol support to https://pulsar.apache.org/[Apache Pulsar™^]{external-link-icon} by introducing a RabbitMQ protocol handler on Pulsar brokers or Pulsar proxies. +By adding the Starlight for RabbitMQ protocol handler to your Pulsar cluster, you can migrate your existing RabbitMQ applications and services to Pulsar without modifying the code. + +== Prerequisites + +You will need the following prerequisites in place to complete this guide: + +* https://helm.sh/docs/intro/install/[Helm 3 CLI^]{external-link-icon} (we used version 3.8.0) +* https://kubernetes.io/docs/tasks/tools/[Kubectl CLI^]{external-link-icon} (we used version 1.23.4) +* Python (we used version 3.8.10) +* Enough access to a K8s cluster to create a namespace, deployments, and pods + +== Install Luna Streaming helm chart + +include::partial$install-helm.adoc[] + +== Forward service port + +We will need to interact with a few of the services in the K8s cluster. Let’s map a few ports to those services. + +include::partial$port-forward-web-service.adoc[] + +include::partial$port-forward-s4r.adoc[] + +== Produce a message with the RabbitMQ Python client + +If you hadn't noticed, we never opened the Pulsar binary port to accept new messages. +Only the admin port and the RabbitMQ port are open. +To further demonstrate how native Starlight for RabbitMQ is, we will use the Pika RabbitMQ Python library to produce and consume messages from Pulsar. + +Save the following Python script to a safe place as `test-queue.py`. +The script assumes you have opened the localhost:5672 port. + +[source,python] +---- +include::{luna-streaming-examples-repo}/starlight-for-rabbitmq/test-queue.py[] +---- + +Open a terminal and return to the safe place where you saved the Python script. +Run the following command to execute the Python program. + +[source,shell] +---- +python ./test-queue.py +---- + +The output should look like the following. + +[souce,shell] +---- +created test-queue queue +published message test +received message: test +deleted test-queue queue +---- + +== Summary + +Wow! That was easy. + +The Luna Helm chart deployed Starlight for RabbitMQ on the Pulsar proxy and opened the correct port. +Your application will now "talk" to Pulsar as if it were a real RabbitMQ host. + +== What's next? + +* xref:streaming-learning:use-cases-architectures:starlight/rabbitmq/index.adoc[Messaging with Starlight for RabbitMQ] +* xref:pulsar-beam.adoc[] +* xref:pulsar-sql.adoc[] +* xref:heartbeat-vm.adoc[] \ No newline at end of file diff --git a/modules/components/partials/port-forward-s4r.adoc b/modules/components/partials/port-forward-s4r.adoc new file mode 100644 index 0000000..26a10b2 --- /dev/null +++ b/modules/components/partials/port-forward-s4r.adoc @@ -0,0 +1,6 @@ +In a separate terminal window, port forward the Starlight for RabbitMQ service. + +[source,shell] +---- +include::{luna-streaming-examples-repo}/starlight-for-rabbitmq/forward-s4r-service.sh[] +---- \ No newline at end of file