Skip to content

Commit a1e9411

Browse files
committed
Added quick start guide. Resolves #1
1 parent 52a783f commit a1e9411

File tree

4 files changed

+47
-50
lines changed

4 files changed

+47
-50
lines changed

docker/run.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,36 +96,40 @@ curl -X POST -H "Content-Type: application/json" --data '
9696
"value.converter.schemas.enable": "false"
9797
}}' http://localhost:8083/connectors -w "\n"
9898

99-
#sleep 2
100-
#echo -e "\nAdding MongoDB Kafka Source Connector for the 'test.pageviews' collection:"
101-
#curl -X POST -H "Content-Type: application/json" --data '
102-
# {"name": "mongo-source",
103-
# "config": {
104-
# "tasks.max":"1",
105-
# "connector.class":"com.mongodb.kafka.connect.MongoSourceConnector",
106-
# "connection.uri":"mongodb://mongo1:27017,mongo2:27017,mongo3:27017",
107-
# "topic.prefix":"mongo",
108-
# "database":"test",
109-
# "collection":"pageviews"
110-
#}}' http://localhost:8083/connectors -w "\n"
99+
sleep 2
100+
echo -e "\nAdding Redis Enterprise Kafka Source Connector for the 'mystream' stream:"
101+
curl -X POST -H "Content-Type: application/json" --data '
102+
{"name": "redis-enterprise-source",
103+
"config": {
104+
"tasks.max":"1",
105+
"connector.class":"com.redislabs.kafka.connect.RedisEnterpriseSourceConnector",
106+
"redis.uri":"redis://redis:6379",
107+
"redis.stream.name":"mystream"
108+
}}' http://localhost:8083/connectors -w "\n"
111109

112110
sleep 2
113111
echo -e "\nKafka Connectors: \n"
114112
curl -X GET "http://localhost:8083/connectors/" -w "\n"
115113

116-
echo "Looking at data in 'pageviews':"
114+
echo "Number of messages in 'pageviews' stream:"
117115
docker-compose exec redis /usr/local/bin/redis-cli xlen pageviews
118116

117+
sleep 2
118+
echo -e "\nAdding messages to Redis stream 'mystream':"
119+
docker-compose exec redis /usr/local/bin/redis-cli "xadd" "mystream" "*" "field1" "message1: value1" "field2" "message1: value2"
120+
docker-compose exec redis /usr/local/bin/redis-cli "xadd" "mystream" "*" "field1" "message2: value1" "field2" "message2: value2"
121+
119122
echo -e '''
120123
124+
121125
==============================================================================================================
122126
Examine the topics in the Kafka UI: http://localhost:9021 or http://localhost:8000/
123127
- The `pageviews` topic should have the generated page views.
124-
- The `mongo.test.pageviews` topic should contain the change events.
125-
- The `test.pageviews` collection in MongoDB should contain the sinked page views.
128+
- The `mystream` topic should contain the Redis stream messages.
129+
- The `pageviews` stream in Redis should contain the sunk page views.
126130
127131
Examine the collections:
128-
- In your shell run: docker-compose exec mongo1 /usr/bin/mongo
132+
- In your shell run: docker-compose exec redis /usr/local/bin/redis-cli
129133
==============================================================================================================
130134
131135
Use <ctrl>-c to quit'''

lombok.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
config.stopBubbling = true
2+
lombok.addLombokGeneratedAnnotation = true

src/site/asciidoc/_attributes.adoc

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/site/asciidoc/quickstart.adoc

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,42 @@ https://docs.docker.com/get-docker/[Docker]
1818

1919
== Run the example
2020

21-
Clone the https://github.com/RedisLabs-Field-Engineering/redis-enterprise-kafka.git[redis-enterprise-kafka] repository:
21+
Clone the https://github.com/RedisLabs-Field-Engineering/redis-enterprise-kafka.git[redis-enterprise-kafka] repository and execute `run.sh` in `docker` directory:
2222

2323
[source,bash]
2424
----
2525
git clone https://github.com/RedisLabs-Field-Engineering/redis-enterprise-kafka.git
26+
cd redis-enterprise-kafka/docker
27+
./run.sh
2628
----
2729

30+
This will:
2831

29-
[TIP]
30-
Use http://asciidoctor.org[Asciidoctor] for the best AsciiDoc experience.footnote:[Not to mention the best looking output!]
31-
Then icon:twitter[role=aqua] about it!
32+
* Run `docker-compose up`
33+
* Wait for Redis, Kafka, and Kafka Connect to be ready
34+
* Register the Confluent Datagen Connector
35+
* Register the Redis Enterprise Kafka Sink Connector
36+
* Register the Redis Enterprise Kafka Source Connector
37+
* Publish some events to Kafka via the Datagen connector
38+
* Write the events to Redis
39+
* Send messages to a Redis stream
40+
* Write the Redis stream messages back into Kafka
3241

33-
toc::[]
42+
Once running, examine the topics in the Kafka control center: http://localhost:9021/
3443

35-
== Sample Section
36-
37-
[square]
38-
* item 1
39-
* item 2
40-
41-
[source,ruby]
44+
* The `pageviews` topic should contain the 10 simple documents added. Each similar to:
45+
[source,json]
4246
----
43-
puts "Hello, World!"
47+
{"viewtime": {"$numberLong": "81"}, "pageid": "Page_1", "userid": "User_8"}
4448
----
4549

46-
[caption=]
47-
.Ruby platforms
48-
|===
49-
|Name |Language
50+
* The `pageviews` stream should contain the 10 change events.
5051

51-
|MRI |C
52-
|JRuby |Java
53-
|Opal |JavaScript
54-
|Rubinius |Ruby
55-
|===
52+
Examine the stream in Redis:
53+
[source,bash]
54+
----
55+
docker-compose exec redis /usr/local/bin/redis-cli
56+
xread COUNT 10 STREAMS pageviews 0
57+
----
5658

57-
include::_attributes.adoc[]
59+
Messages added to the `mystream` stream will show up in the `mystream` topic

0 commit comments

Comments
 (0)