Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Outline

Event Brokering with Spring Boot and RabbitMQ

This application implements an Event mechanism usable in Microservice environments.

Scenario

  • a publisher publishes events with one of these topics
    • customer.created
    • customer.edited
    • customer.deleted
    • order.created
    • order.edited
    • order.deleted
    • invoice.created
    • invoice.edited
    • invoice.deleted
  • a subscriber subscribes to events of a specific topic from a queue specific to its (micro-)service

Event scenario

Usage

  1. Install RabbitMQ (if it's installed on another host than localhost then you need to change the connection properties in application.properties)
  2. start a couple instances of the demo application in subscriber mode, for example:
    • ./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service1Queue -Dsubscriber.routingKey=customer.*
    • ./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service2Queue -Dsubscriber.routingKey=.*created
    • ./gradlew bootrun -Dspring.profiles.active=subscriber -Dsubscriber.queue=service3Queue -Dsubscriber.routingKey=*.*
  3. start a single instance of the demo application in publisher mode:
    • ./gradlew bootrun -Dspring.profiles.active=publisher
  4. check the log output of the publisher and the subscribes to see which events are produced and which events are consumed by each subscriber
Morty Proxy This is a proxified and sanitized view of the page, visit original site.