Skip to content

mikenoethiger/bank-server-rabbitmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protocol | bank-client | bank-server-socket | bank-server-graphql | bank-server-rabbitmq

About

RabbitMQ implementation of the bank server backend. The client counterpart can be found here.

Prerequisites

A RabbitMQ server is required, which runs standalone rather than embedded in this program. See here for installation instructions. The easiest way is to start a docker container:

$ docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management

You can check the RabbitMQ management UI in your browser at localhost:15672. Default User/Pass is guest/guest.

Notice: Depending on where you run RabbitMQ, you have to adjust the connection credentials in bank.Server (constants at the top.) However, if you use the standard installation on localhost, the default credentials should already be fine.

Run

From your IDE, run bank.Server as a java application.

Or with gradle:

$ gradle run

Implementation Notices

  • Requests are accepted through the bank.requests queue and the response is published to the replyTo queue declared in the request message. The Client has to take care about request/response synchronization, since the bank.requests and replyTo queues are decoupled. This is implemented on the client side by creating an empty java BlockingQueue for each request, which receives the response from the replyTo queue as soon as available (see MqBankDriver.sendRequest())
  • Account updates are published to the bank.updates fanout exchange. Clients can subscribe to this exchange to receive account updates, thus being notified about changes triggered by other clients.

About

Minimal bank server backend RabbitMQ implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages