Reputation: 189
We have an operation that have to be triggered when a certain number of messages have been sent in a Spring Integration pipeline.
In fact when the sum of Discarded Messages plus Successfully sent messages plus Error sent messages ( in a HttpComponentsMessageSender ) arrive to a certain number.
I've seen there is something called "" that stores the metrics, but how to trigger something based on its numbers ?
Upvotes: 1
Views: 94
Reputation: 121272
Looks like an Aggregator
EI pattern is fully for you:
http://www.enterpriseintegrationpatterns.com/patterns/messaging/Aggregator.html http://docs.spring.io/spring-integration/reference/html/messaging-routing-chapter.html#aggregator
So, you correlate all those messages with some correlationStrategy
.
The custom releaseStrategy
decides if a condition for all messages in that group has been met and you produce a message from that aggregator to some channel for performing a desired trigger action.
Upvotes: 2