Skip to content

Commit

Permalink
Merge Starlight for RabbitMQ guide (#95)
Browse files Browse the repository at this point in the history
* Auto stash before merge of "using-s4k-guide" and "release/2.10_1.x"

* Added S4K install guide

* Use new branch

* Added page to nav, remove old page

* Added port forward and new nav link

* cleanup

* cleanup-complete

* tm-and-external-links

Co-authored-by: Mendon Kissling <[email protected]>
  • Loading branch information
ddieruf and mendonk authored Jan 26, 2023
1 parent a245c99 commit 8d35918
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/components/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
** xref:starlight-for-kafka.adoc[]
** xref:starlight-for-rabbitmq.adoc[]
7 changes: 5 additions & 2 deletions modules/components/pages/starlight-for-kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
74 changes: 74 additions & 0 deletions modules/components/pages/starlight-for-rabbitmq.adoc
Original file line number Diff line number Diff line change
@@ -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[]
6 changes: 6 additions & 0 deletions modules/components/partials/port-forward-s4r.adoc
Original file line number Diff line number Diff line change
@@ -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[]
----

0 comments on commit 8d35918

Please sign in to comment.