GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — rabbitmq-tutorials/scala at master · rohochan/rabbitmq-tutorials

Expand file tree

/

scala

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

scala

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main/scala
src/main/scala
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

RabbitMQ Tutorials in Scala

This is a minimalistic Scala port of the RabbitMQ tutorials in Java. The port is admittedly quite close to Java in terms of code style. This is primarily to the fact that RabbitMQ Java client still supports JDK 6 and doesn't have a lambda-friendly API.

Compiling the Code

mvn compile

Running Examples

Hello World

Execute the following command to receive a hello world:

mvn exec:java -Dexec.mainClass="Recv"

Execute the following in a separate shell to send a hello world:

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

Work Queues

Send a message which will be finshed immediately:

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

Send a message which need some second to execute each . is one second.

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

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

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

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

Publish and Subscriber

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

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

RPC

In one shell:

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

In another shell:

mvn exec:java -Dexec.mainClass="RPCClient"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.