ewolff / microservice-atom

Demo to show how Atom can be used for communication between microservices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microservice Atom Sample

Deutsche Anleitung zum Starten des Beispiels

This is a sample to show how the Atom protocol can be used for the communication between microservices. Atom is originally designed to let users subscribe to feeds like blogs. Any new blog post is published in the feed. However, this approach can be used for data such as information about order, too.

The project creates Docker containers.

It uses three microservices:

  • Order to create orders. This services exposes an Atom feed with all orders.
  • Shipment polls the feed every thirty seconds and extract the information needed to ship the items.
  • Invoicing polls the feed, too. It extracts all information to send out an invoice.

Technologies

  • Spring Boot
  • Rome to produce and parse Atom feeds.
  • Docker Compose to link the containers.

How To Run

See How to run for details.

Remarks on the Code

The microservices are:

The microservices have an Java main application in src/test/java to run them stand alone. microservice-demo-shipping and microservice-demo-invoicing both use a stub for the other order service for the tests.

The data of an order is copied - including the data of the customer and the items. So if a customer or item changes in the order system this does not influence existing shipments and invoices. It would be odd if a change to a price would also change existing invoices. Also only the information needed for the shipment and the invoice are copied over to the other systems.

The job to poll the Atom feed is run every 30 seconds.

About

Demo to show how Atom can be used for communication between microservices

License:Apache License 2.0


Languages

Language:Java 79.0%Language:HTML 19.4%Language:Dockerfile 1.2%Language:Shell 0.4%