Skip to content

Event Driven Microservices

Lyes S edited this page Sep 27, 2021 · 36 revisions

Welcome to the Publisher/Subscriber Microservices Sample wiki!

Included Pages

Table Of Contents

What Is Event-Driven Architecture ?

Event Driven Architecture (EDA), is the pattern enabling the service to service communication via events and handling data changes as events. It highly supports loosely coupling and autonomous design principles. [1]

What Are Microservices ?

Microservices (also known as the microservice architecture), is an architectural style that structures an application as a collection of services that are

  • Highly maintainable and testable
  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities
  • Owned by a small team

The microservice architecture enables the rapid, frequent and reliable delivery of large, complex applications. [2]

What Is Java Message Service ?

The Java Message Service (JMS) was designed to make it easy to develop business applications that asynchronously send and receive business data and events. JMS defines a set of interfaces and semantics that allow Java applications to communicate with other messaging implementations. A JMS implementation is known as a JMS provider, such as : Apache ActiveMQ. [3]

ActiveMQ Message Delivery Models

Point-to-Point (Queue destination)

"In this model, a message is delivered from a producer to one consumer. The messages are delivered to the destination, which is a queue, and then delivered to one of the consumers registered for the queue. While any number of producers can send messages to the queue, each message is guaranteed to be delivered, and consumed by one consumer. If no consumers are registered to consume the messages, the queue holds them until a consumer registers to consume them." [3] "So Queues implement a reliable load balancer in JMS." [4]

Publish/Subscribe (Topic destination)

"In this model, a message is delivered from a producer to any number of consumers. Messages are delivered to the topic destination, and then to all active consumers who have subscribed to the topic. In addition, any number of producers can send messages to a topic destination, and each message can be delivered to any number of subscribers. If there are no consumers registered, the topic destination doesn't hold messages unless it has durable subscription for inactive consumers. A durable subscription represents a consumer registered with the topic destination that can be inactive at the time the messages are sent to the topic." [3]

Virtual Topics (Virtual Destinations)

Virtual topics are a combination of topics and queues.

"The idea behind virtual topics is that producers send to a topic in the usual JMS way. Consumers can continue to use the Topic semantics in the JMS specification. However if the topic is virtual, consumer can consume from a physical queue for a logical topic subscription, allowing many consumers to be running on many machines & threads to load balance the load." [4]

Objective

The purpose of this study is to implement service to service communication via asynchronous message processing approach [5] based on Virtual Topics in the microservices ( Architecture ) context with Java Ecosystem ( Technology Stack ).