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 — GitHub - wheezil/rabbitmq-rpc-example

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
src/main
src/main
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

rabbitmq-rpc-example

I built this example to better understand how to use RabbitMQ's RpcClient class in Java. There are two parts:

  1. RpcClientTest
  2. RpcServerTest

In the RpcClientTest code, you can set

  • THREADS: number of client threads
  • ITER: number of calls made by each thread
  • TIMEOUT_MS: how long to wait for reply before timing out

Build the project using maven:

mvn package

then open a command-line, cd to the "target" folder of the project Start the server:

$ java -cp example-1.0-shaded.jar RpcServerTest

In a separate command-line, start the client:

$ java -cp example-1.0-shaded.jar RpcClientTest

At this point, you will see a pile of log messages in both windows. Congratulations! Some things to note about this example:

  • If you run the client before the server, you will see timeout messages.
  • The number of server threads is not specified. RabbitMQ defaults to 2x CPU.
  • The client doesn't need to synchronize use of RpcClient.
  • The server doesn't need to synchronize use of the channel for basicReply().

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — 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.