Skip to content

Commit 2c54f1b

Browse files
Merge pull request #698 from nathanfallet/new-kotlin-tutorials
new kotlin tutorials
2 parents 4c821a1 + dd194cf commit 2c54f1b

33 files changed

+1157
-60
lines changed

kotlin-java-client/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/*
2+
.gradle/*

kotlin-java-client/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# RabbitMQ Tutorials in Kotlin
2+
3+
This is a minimalistic Kotlin port of the [RabbitMQ tutorials in Java](https://www.rabbitmq.com/getstarted.html).
4+
The port is admittedly quite close to Java in terms of code style.
5+
6+
7+
## Compiling the Code
8+
9+
``` shell
10+
gradle clean compileKotlin
11+
```
12+
13+
## Running the Tutorials
14+
15+
### Tutorial 1
16+
17+
Execute the following command to start a Hello, world consumer
18+
19+
``` shell
20+
gradle run -P main=Recv
21+
```
22+
23+
Execute the following in a separate shell to publish a Hello, world messge:
24+
25+
``` shell
26+
gradle run -P main=Send
27+
```
28+
29+
### Tutorial 2
30+
31+
Send a task message. The task will be completed immediately
32+
33+
``` shell
34+
gradle run -P main=NewTask
35+
```
36+
37+
To start a worker (run in a separate shell):
38+
39+
``` shell
40+
gradle run -P main=Worker
41+
```
42+
43+
Send a task message. It will wait for 1 second for each dot in the payload.
44+
45+
``` shell
46+
gradle run -P main=NewTask -P argv="rabbit1 ...."
47+
```
48+
49+
Add more workers to the same queue, message will be distributed in the
50+
round robin manner.
51+
52+
### Tutorial 3
53+
54+
``` shell
55+
gradle run -P main=ReceiveLogs
56+
```
57+
58+
59+
``` shell
60+
gradle run -P main=EmitLog -P argv="rabbit1, msg1"
61+
```
62+
63+
### Tutorial 4
64+
65+
``` shell
66+
gradle run -P main="ReceiveLogsDirect" -P argv="info,error"
67+
```
68+
69+
``` shell
70+
gradle run -P main=EmitLogDirect"
71+
```
72+
73+
### Tutorial 5
74+
75+
``` shell
76+
gradle run -P main=ReceiveLogsTopic -P argv="anonymous.*"
77+
```
78+
79+
``` shell
80+
gradle run -P main=EmitLogTopic -P argv="anonymous.info"
81+
```
82+
83+
### Tutorial 6
84+
85+
In one shell:
86+
87+
``` shell
88+
gradle run -P main=RPCServer
89+
```
90+
91+
In another shell:
92+
93+
``` shell
94+
gradle run -P main=RPCClient
95+
```
File renamed without changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
main =
2+
argv =
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)