Reputation: 768
Please Note : I am new to Spring Integration.
I am writing a simple ETL flow using Spring integration where each stage of processing is connected to the next via simple Direct Channels.
In some stages there is a one to many relationship or event explosion happening i.e. an event containing a new file to be processed is passed to a consumer via a channel and the consumer is parsing the file. In these kind of cases I am not using a service-activator but opted to simply parse the file and send messages using a MessagingTemplate to the next stage via a different (or output) direct channel.
In this kind of scenario the Spring Integration Diagram in Intellij does not detect the connection between the file parsing stage and the output channel (via the messaging template).
While it is understandable that this is to be expected given the dependency is not direct, is there a different way I can change my setup so that this dependency does becomes visible in the 'Spring Integration diagram' in Intellij ?
I am using Intellij Ultimate Edition 2019.
Upvotes: 0
Views: 330
Reputation: 121272
That's correct: as long as you use a MessagingTemplate
by yourself you break a flow because it it based on the input
and output
channel options of the endpoints.
According your task it sounds like you need a FileSplitter
and an ExecutorChannel
to process each parsed line separately downstream.
See docs for more info:
https://docs.spring.io/spring-integration/docs/current/reference/html/core.html#executor-channel
https://docs.spring.io/spring-integration/docs/current/reference/html/file.html#file-splitter
Upvotes: 1