1
votes

I have a problem creating/modeling integration flow for the next global use case:

  • Input to the system is some kind of Message. That message goes through Splitter and Transformer Endpoint and after that on ServiceActivator where that transformed message is processed. This use case is clear for me.
  • Confusion occurs because of the next part. After the ServiceActivator finishes processing I need to took the base Message (message from the beginning of first part) again and put it in other processing, for example again through Splitter and Transformer. How can I model that use case? Can I return the message payload to that base value? Is there some component that could help me?

Hope I describe it well.

1

1 Answers

1
votes

Your use-case sounds more like a PublishSubscribeChannel: https://docs.spring.io/spring-integration/docs/current/reference/html/core.html#channel-implementations-publishsubscribechannel. So, you are going to have several subscribers (splitters) for that channel and the same input message is going to be processed in those independent sub-flows. You even can do that in parallel if you configure an Executor into that PublishSubscribeChannel.

Another way, if you can do that in parallel and you still need some result from that ServiceActivator to be available alongside with an original message for the next endpoint or so, then you can use a HeaderEnricher to store an original message in the headers ad get access to it whenever you need in your flow: https://docs.spring.io/spring-integration/docs/current/reference/html/message-transformation.html#header-enricher