someshbhardwaj / spring-cloud-kafka-saga-pattern

Event Driven Architecture using Spring Cloud with Kafka-stream as binder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spring-cloud-kafka-saga-pattern

Pre-requisites: Install Kafka Install Spring Install Java

Start Zookeper

zookeeper-server-start.bat d:\Software\kafka_2.13-2.5.0\config\zookeeper.properties

Start Kafka server

kafka-server-start.bat d:\Software\kafka_2.13-2.5.0\config\server.properties

Create Order Request Image Image of Create An Order

Get All Order Request Image Image of Search

Project Code Flow Image Image of Project Code Flow

Snippets from Application.yml 
spring.cloud.stream:
  function:
     definition: orderEventPublisher;shippingEventPublisher;orderEventProcessor;shippingEventProcessor;paymentEventConsumer;shippingEventConsumer
  bindings:
    orderEventPublisher-out-0:
      destination: order-events
    orderEventProcessor-in-0:
      destination: order-events
    orderEventProcessor-out-0:
      destination: payment-events
    paymentEventConsumer-in-0:
      destination: payment-events
    shippingEventPublisher-out-0:
      destination: shppingafterpayment-events  
    shippingEventProcessor-in-0:
      destination: shppingafterpayment-events
    shippingEventProcessor-out-0:
      destination: shipping-events
    shippingEventConsumer-in-0:
      destination: shipping-events

You can further take the code and make the changes to add the DB to it. You can also make the kafka cluster and use it and also add the concurrency to the same code.

About

Event Driven Architecture using Spring Cloud with Kafka-stream as binder.


Languages

Language:Java 100.0%