GithubHelp home page GithubHelp logo

jordanec / rabbitmq-sample-covid-19 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 68 KB

Simple broadcaster RabbitMq and Spring AMQP.

License: GNU General Public License v2.0

Java 100.00%
rabbitmq spring-amqp docker mysql spring-boot gradle covid-19

rabbitmq-sample-covid-19's Introduction

Sample covid-19 updates broadcaster

Simple broadcaster of updates of covid-19 stats by country/continent using RabbitMq and Spring AMQP. There are 2 spring boot applications, the sender broadcasts updates and there could be N number of consumers subscribed to those updates based on the continent or country that are listening.

In the sender application, there's a controller to publish updates. Set country (Alpha-3) and continent (Alpha-2) names using these codes: https://www.iban.com/country-codes and https://datahub.io/core/continent-codes/r/0.html

[POST] http://localhost:8080/samplecovid19/update/create
Body:
{
"continent": "CR" ,
"countryName": "CRI" ,
"cases": 435 ,
"deaths": 2 ,
"recovered": 13
}

Updates will be printed on receivers console

How to run

  • Run docker dependencies: docker-compose up -d

  • Run the sender application: ./gradlew sender:bootrun

  • Run receivers setting different ports, continents and countries parameters:
    Listen updates of Central America
    ./gradlew receiver:bootrun -Pargs=--server.port=8081,--topic.continent=CA

    Listen updates of Costa Rica
    ./gradlew receiver:bootrun -Pargs=--server.port=8082,--topic.continent=CA,--topic.country=CRC

    Listen updates of North America
    ./gradlew receiver:bootrun -Pargs=--server.port=8083,--topic.continent=NA

    Listen updates of United States
    ./gradlew receiver:bootrun -Pargs=--server.port=8084,--topic.continent=NA,--topic.country=USA

    Listen updates of South America
    ./gradlew receiver:bootrun -Pargs=--server.port=8085,--topic.continent=SA

    Listen updates of Brazil
    ./gradlew receiver:bootrun -Pargs=--server.port=8086,--topic.continent=SA,--topic.country=BRA

    Listen updates of Europe
    ./gradlew receiver:bootrun -Pargs=--server.port=8087,--topic.continent=EU

    Listen updates of Germany
    ./gradlew receiver:bootrun -Pargs=--server.port=8088,--topic.continent=EU,--topic.country=DEU

    Listen updates of Italy
    ./gradlew receiver:bootrun -Pargs=--server.port=8089,--topic.continent=EU,--topic.country=ITA

    Listen updates of Spain
    ./gradlew receiver:bootrun -Pargs=--server.port=8090,--topic.continent=EU,--topic.country=ESP

    Listen updates of Asia
    ./gradlew receiver:bootrun -Pargs=--server.port=8091,--topic.continent=AS

    Listen updates of China
    ./gradlew receiver:bootrun -Pargs=--server.port=8092,--topic.continent=AS,--topic.country=CHN

    Listen updates of South Korea
    ./gradlew receiver:bootrun -Pargs=--server.port=8093,--topic.continent=AS,--topic.country=KOR

rabbitmq-sample-covid-19's People

Contributors

jordanec avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.