Coder Social home page Coder Social logo

messaging_poc_infrastructure's Introduction

Artemis ActiveMQ

Goal

  • create an environment in order to simulate various use cases (docker compose)
  • install and configure several artemis activemq brokers, that participate in a cluster
  • brokers should be high available (automatic failover, loadbalancing)
  • producer & consumer applications should be configured to communicate with brokers
  • play around with configuration (user/roles properties and security conf)

Implementation

  • docker compose with vromero/activemq-artemis:2.10.1 image
  • 4 brokers (2 live and 2 backup)
  • producerApp (spring-boot) which sends messages when accessing /chat endpoint (connect over udp broadcast)
  • consumerApp (spring-boot) which connects to the cluster over udp and broadcast
  • configuration files for user/roles/high-availability/cluster that are attached to the container (docker volumes)

The producer sends messages to the cluster. And the consumer connects to the cluster (only to one broker) and consumes the messages and prints them out. The cluster is symmetric, means every node in the cluster is connected to every other node over one hop. The live servers(activemq0, activemq2) in the cluster are connected over cluster connection. The load is distributed among them. The backup server become active, when the live server shuts down.

Build & Run

first the java application (producer) has to be compiled and linked!
/messaging_poc_infrastructure/demo$ mvn clean install

then the docker environment has to be set up
/messaging_poc_infrastructure$ docker-compose up -d --build

to shutdown the environment
/messaging_poc_infrastructure$ docker-compose down

call producer endpoint /chat in order to generate test message on testQueue topic
/messaging_poc_infrastructure$ curl http://localhost:8081/chat

to print the log outputs of consumer
/messaging_poc_infrastructure$ docker logs -f messaging_poc_infrastructure_consumer_app_1

login on http://localhost:8161/console
user: admin
password: admin

Use cases

http://localhost:8081/chatLoop?loop=true&duration=30&sleep=100

  • sends messages in a loop
  • duration means the amount of messages
  • sleep is the timeout between each message
  • send the messages and the consumer will display them in the console output (docker logs)

2 brokers in one cluster

  • broker balance the load between 2 nodes

messaging_poc_infrastructure's People

Contributors

richardkrasowski0000 avatar krasowskir avatar

Stargazers

Tyshchenko Iryna avatar

Watchers

James Cloos 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.