8000 README edits · sardesh/rabbitmq-tutorials@960a8fa · GitHub
[go: up one dir, main page]

Skip to content

Commit 960a8fa

Browse files
README edits
1 parent 582d693 commit 960a8fa

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

scala/README.md

Lines changed: 26 additions & 15 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,57 @@
1-
# Compile the code
1+
# RabbitMQ Tutorials in Scala
2+
3+
This is a minimalistic Scala port of the RabbitMQ tutorials in Java.
4+
The port is admittedly quite close to Java in terms of code style.
5+
This is primarily to the fact that RabbitMQ Java client still supports
6+
JDK 6 and doesn't have a lambda-friendly API.
7+
8+
9+
## Compiling the Code
210

311
mvn compile
412

5-
## Hello World
613

7-
Execute the following command to send a hello world.
14+
## Running Examples
815

9-
mvn exec:java -Dexec.mainClass="Send"
16+
### Hello World
1017

11-
Execute the following command to send a hello world.
18+
Execute the following command to receive a hello world:
19+
20+
mvn exec:java -Dexec.mainClass="Recv"
21+
22+
Execute the following in a separate shell to send a hello world:
1223

1324
mvn exec:java -Dexec.mainClass="Send"
1425

15-
## Work Queues
26+
### Work Queues
1627

17-
Send a message which will be finshed immediately
28+
Send a message which will be finshed immediately:
1829

1930
mvn exec:java -Dexec.mainClass="NewTask"
2031

21-
Send a message which need some second to execute each . is one second
32+
Send a message which need some second to execute each . is one second.
2233

2334
mvn exec:java -Dexec.mainClass="NewTask" -Dexec.args="rabbit1 ...."
2435

25-
Open worker. Add more workers to process, message will be handled in round robin way.
36+
To start a worker (run in a separate shell):
2637

2738
mvn exec:java -Dexec.mainClass="Worker"
2839

29-
Kill a worker which is processing message. The message will be still in the queue and will be received by another worker.
40+
Add more workers to the same queue, message will be distributed in the
41+
round robin manner.
3042

31-
## Publish and Subscriber
43+
### Publish and Subscriber
3244

3345
mvn exec:java -Dexec.mainClass="EmitLog" -Dexec.args="rabbit1 msg1"
3446

3547
mvn exec:java -Dexec.mainClass="ReceiveLogs"
3648

37-
## RPC
49+
### RPC
3850

39-
Open a shell and execute for the `RPCServer`. `rabbit1` is the host for RabbitMQ, without any execute parameters means to localhost.
51+
In one shell:
4052

4153
mvn exec:java -Dexec.mainClass="RPCServer"
4254

43-
44-
Open another shell and execute for the `RPCClient`.
55+
In another shell:
4556

4657
mvn exec:java -Dexec.mainClass="RPCClient"

0 commit comments

Comments
 (0)
0