Skip to content

Commit ba6dad6

Browse files
authored
Merge pull request #15 from datastax/using-s4r-guide
Merge Starlight for RabbitMQ guide
2 parents 7bdc672 + 8122b9f commit ba6dad6

File tree

1 file changed

+38
-19
lines changed
  • modules/use-cases-architectures/pages/starlight/rabbitmq

1 file changed

+38
-19
lines changed

modules/use-cases-architectures/pages/starlight/rabbitmq/index.adoc

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@
44
:title: Getting started with the Starlight for RabbitMQ extension
55
:navtitle: Starlight for RabbitMQ
66

7-
Starlight for RabbitMQ acts as a proxy between your https://www.rabbitmq.com/[RabbitMQ^]{external-link-icon} application and https://pulsar.apache.org/[Apache Pulsar™^]{external-link-icon} cluster. It implements the AMQP 0.9.1 protocol used by RabbitMQ clients and translates AMQP frames and concepts to Pulsar ones.
7+
Starlight for RabbitMQ acts as a proxy between your https://www.rabbitmq.com/[RabbitMQ^]{external-link-icon} application and https://pulsar.apache.org/[Apache Pulsar™^]{external-link-icon} cluster.
8+
It implements the AMQP 0.9.1 protocol used by RabbitMQ clients and translates AMQP frames and concepts to Pulsar concepts.
89

910
If source code is your thing, visit the https://github.com/datastax/starlight-for-rabbitmq[project's repo on GitHub^]{external-link-icon}.
1011

1112
== Architecture reference
1213

13-
If you would like to get deep into how Starlight for RabbitMQ works, xref:starlight-for-rabbitmq:ROOT:index.adoc[read the docs].
14+
If you want to dive deep into how Starlight for RabbitMQ works, xref:starlight-for-rabbitmq:ROOT:index.adoc[read the documentation].
1415

1516
image:s4r-architecture.png[Starlight for RabbitMQ Architecture]
1617

1718
== Establishing the RabbitMQ protocol handler
1819

19-
Before you can use a RabbitMQ client to interact with your Pulsar cluster, you need the Starlight for RabbitMQ protocol handler installed in the cluster. Installation looks a bit different depending on where your Pulsar cluster is running. Choose the option that best fits your needs.
20+
Before you can use a RabbitMQ client to interact with your Pulsar cluster, you need the Starlight for RabbitMQ protocol handler installed in the cluster.
21+
Installation looks a bit different depending on where your Pulsar cluster is running.
22+
Choose the option that best fits your needs.
2023

2124
[tabs]
2225
====
@@ -52,21 +55,25 @@ The Starlight for RabbitMQ extension is included in the `luna-streaming-all` ima
5255
Self Managed::
5356
+
5457
--
55-
Already got your own Pulsar Cluster? Or maybe your using a standalone cluster? Starlight for RabbitMQ can easily be a part of that cluster! Follow the "xref:starlight-for-rabbitmq:installation:getting-started.adoc[]" guide.
58+
Already have your own Pulsar Cluster? Or maybe you're using a standalone cluster? Starlight for RabbitMQ can easily be a part of that cluster! Follow the "xref:starlight-for-rabbitmq:installation:getting-started.adoc[]" guide.
5659
--
5760
====
5861

5962
== Messaging with Starlight for RabbitMQ
6063

61-
Starlight for RabbitMQ supports quite a few different use cases. With a Pulsar cluster between publishers and consumers you can interchange the type of publisher and consumer to fit your needs. *The below examples are using an Astra Streaming tenant as the AMQP listener.* If you are using Luna or self-managed, switch the listener URL for your own.
64+
Starlight for RabbitMQ supports quite a few different use cases.
65+
With a Pulsar cluster between publishers and consumers you can interchange the type of publisher and consumer to fit your needs.
66+
67+
*The below examples are using an Astra Streaming tenant as the AMQP listener.* If you are using Luna Streaming or a self-managed tenant, switch the listener URL for your own.
6268

6369
=== Retrieve RabbitMQ connection properties in Astra Streaming
6470

65-
While on the "Connect" tab in the Astra Streaming portal, the "RabbitMQ" area will provide important connection information. You will need that to create a working RabbitMQ client or using the CLI.
71+
In the Astra Streaming portal "Connect" tab, the "RabbitMQ" area provides important connection information.
72+
You will need this connection information to create a working RabbitMQ client or use the CLI.
6673

6774
image:rabbitmq-client-settings.png[Astra Streaming RabbitMQ settings]
6875

69-
TIP: While reviewing the RabbitMQ connection settings in the Astra portal, if you click the clipboard icon you will get those values as well as a working token to paste in code.
76+
TIP: Click the clipboard icon to copy the RabbitMQ connection values, as well as a working token to paste in code.
7077

7178
=== Produce and consume a message
7279

@@ -75,18 +82,19 @@ TIP: While reviewing the RabbitMQ connection settings in the Astra portal, if yo
7582
RabbitMQ Client (Java)::
7683
+
7784
--
78-
This example uses maven as the project structure. If you prefer gradle or another, this code should still be a good fit.
85+
This example uses Maven for the project structure.
86+
If you prefer Gradle or another tool, this code should still be a good fit.
7987
80-
TIP: Visit our https://github.com/datastax/astra-streaming-examples[examples repo^]{external-link-icon} to see the complete source of this example.
88+
TIP: Visit our https://github.com/datastax/astra-streaming-examples[examples repo^]{external-link-icon} to see the complete source for this example.
8189
82-
. Create a new maven project.
90+
. Create a new Maven project.
8391
+
8492
[source,shell]
8593
----
8694
include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-client/create-project.sh[]
8795
----
8896
89-
. Open the new project in your favorite IDE or text editor and add the Kafka client dependency to "pom.xml".
97+
. Open the new project in your favorite IDE or text editor and add the RabbitMQ client dependency to "pom.xml".
9098
+
9199
[source,xml]
92100
----
@@ -97,7 +105,9 @@ include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-cl
97105
</dependency>
98106
----
99107
100-
. Open the file "src/main/java/org/example/App.java" and replace the entire contents with the below code. Notice there are class variables that need replacing. Apply the values previously retrieved in Astra Streaming.
108+
. Open the file "src/main/java/org/example/App.java" and replace the entire contents with the below code.
109+
Notice there are class variables that need replacing.
110+
Apply the values previously retrieved in Astra Streaming.
101111
+
102112
[source,java]
103113
----
@@ -106,43 +116,52 @@ include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-cl
106116
+
107117
NOTE: Don't worry if your editor shows errors, this isn't a complete program... yet.
108118
109-
. Bring in the following code to create a valid connection, channel, and queue that will be used by both the producer and consumer.
119+
. Add the following code to create a valid connection, a channel, and a queue that will be used by both the producer and consumer.
110120
+
111121
[source,java]
112122
----
113123
include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-client/StarlightForRabbitMqClient/src/main/java/org/example/App.java[tag=create-queue]
114124
----
115125
116-
. Now paste the producer code into the file. This is a very simple flow that sends a single message and awaits acknowledgment.
126+
. Add the producer code to the file.
127+
This is a very simple flow that sends a single message and awaits acknowledgment.
117128
+
118129
[source,java]
119130
----
120131
include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-client/StarlightForRabbitMqClient/src/main/java/org/example/App.java[tag=build-producer]
121132
----
122133
123-
. Paste the consumer code into the file. This creates a basic consumer with callback on message receipt. Because the consumer isn't a blocking thread, we'll sleep for a few seconds and let things process.
134+
. Add the consumer code to the file.
135+
This creates a basic consumer with callback on message receipt.
136+
Because the consumer isn't a blocking thread, we'll sleep for a few seconds and let things process.
124137
+
125138
[source,java]
126139
----
127140
include::{astra-streaming-examples-repo}/java/starlight-for-rabbitmq/rabbitmq-client/StarlightForRabbitMqClient/src/main/java/org/example/App.java[tag=build-consumer]
128141
----
129142
130-
. Now you should have a complete program. Let's see it in action! Build and run the jar with the following terminal commands.
143+
. You now have a complete program, so let's see it in action!
144+
Build and run the jar with the following terminal commands.
131145
+
132146
[source,shell]
133147
----
134148
mvn clean package assembly:single
135149
java -jar target/StarlightForRabbitMqClient-1.0-SNAPSHOT-jar-with-dependencies.jar
136150
----
137151
138-
. If all goes as it should your output will be similar to this:
152+
. If all goes as it should, your output will be similar to this:
139153
+
140154
[source,shell]
141155
----
142156
Sent 'Hello World!'
143157
Received 'Hello World!'
144158
----
145159
146-
Congrats! You have just used the RabbitMQ client to send and receive messages in Pulsar.
160+
Congrats! You used the RabbitMQ client to send and receive messages in Pulsar.
147161
--
148-
====
162+
====
163+
164+
== What's next?
165+
166+
* xref:starlight-for-rabbitmq:ROOT:index.adoc[Starlight for RabbitMQ documentation]
167+
* xref:luna-streaming:components:starlight-for-rabbitmq.adoc[]

0 commit comments

Comments
 (0)