1 Star 0 Fork 0

zhzhouq9/rabbitmq-tutorials

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

RabbitMQ Tutorials in Kotlin

This is a minimalistic Kotlin port of the RabbitMQ tutorials in Java. The port is admittedly quite close to Java in terms of code style.

Compiling the Code

gradle clean compileKotlin

Running the Tutorials

Tutorial 1

Execute the following command to start a Hello, world consumer

gradle run -P main=Recv

Execute the following in a separate shell to publish a Hello, world messge:

gradle run -P main=Send

Tutorial 2

Send a task message. The task will be completed immediately

gradle run -P main=NewTask

To start a worker (run in a separate shell):

gradle run -P main=Worker

Send a task message. It will wait for 1 second for each dot in the payload.

gradle run -P main=NewTask -P argv="rabbit1 ...."

Add more workers to the same queue, message will be distributed in the round robin manner.

Tutorial 3

gradle run -P main=ReceiveLogs
gradle run -P main=EmitLog -P argv="rabbit1, msg1"

Tutorial 4

gradle run -P main="ReceiveLogsDirect" -P argv="info,error"
gradle run -P main=EmitLogDirect"

Tutorial 5

gradle run -P main=ReceiveLogsTopic -P argv="anonymous.*"
gradle run -P main=EmitLogTopic -P argv="anonymous.info"

Tutorial 6

In one shell:

gradle run -P main=RPCServer

In another shell:

gradle run -P main=RPCClient
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/zhzhouq9/rabbitmq-tutorials.git
git@gitee.com:zhzhouq9/rabbitmq-tutorials.git
zhzhouq9
rabbitmq-tutorials
rabbitmq-tutorials
master

搜索帮助