Message Splitter Pattern in Microservice
Message Splitter Pattern in Microservice
Let's understand the problem first.
Consider many messages that are processed by an enterprise solution have multiple micro service. An order placed by a consumer, for instance, may contain multiple line items. Each line item can require the attention of a different inventory system, as stated in the description of the Content-Based Router. As a result, we must devise a method for processing an order in its entirety while still treating each order component separately.
When a message has numerous pieces, each of which might need to be processed differently, how can we process the message?
Then IBM came with unique solution- Using a Message Splitter pattern to split a large message into smaller elements for processing by one or more targets/ services.
Let's drill down the solution in 3 easy steps.
- Enrich with Original Event.
here i am trying to split into many messages keeping original as base.
- Change data capture into many events.
I am tying to capture the event that got triggered while any change happen in database table.
- Splitting message/events into multiple items for other services.
note:- please ignore bad handwriting and drawing buddy.💡