This week, we’ll study a pattern known as Event-Driven Consumer.
When do I use this pattern?
When the system consumes the message as soon as it is available, the consumer is said to be an Event-Driven Consumer. The message pattern used in Event-Driven Consumer is an Event Message.
Event-Driven Consumer in CPI
For the demonstration, let’s go through examples in the Event Message blog.
Sending Product Update from ECC
The integration flow starts with the IDoc adapter. As soon as ECC dispatches the IDoc and Integration receives it, the processing is started. Note that the Integration flow will sit idly by until ECC sends the IDoc out. The message that is received here is known as Event Message. And, the integration flow is known as Event-Driven Consumer.
Subscribing to Salesforce’s Custom Platform Event Channel
In this integration flow, the Event Message is sent by the Salesforce system. When the Event Message arrives at integration, the integration flow begins processing the event. The steps include
- Preparing the query message
- Getting all product-related data from Salesforce
- Logging the information
Once again, the integration flow only starts processing when Salesforce triggers the Event Message. Until then, the integration flow is inactive.
Event-Driven Consumers consume the message as soon as it is available. The message pattern for the message is Event Message.
Hope this helps,
About the Author
More Content by Bhalchandra Wadekar