Reputation: 4574
I am new to Spring-integration and trying to design a relatively abstract architecture in java that could accomodate inputs and outputs of various natures. For example on input : pick a file or get an http request or read from a DB etc.. output : send an email or http reply(eg json) or create a report/pdf/whatever etc.. What could be a good design for such entry/exit points in the application ? For example on the input side, could I use several different gateways or adapters that could be possibly attached to the same input channel, from where the nature of the input could be then resolved and processed accordingly ?
Any suggestion/example of a good design for such entry/exit points would be more than welcome.
Cheers
Upvotes: 0
Views: 30
Reputation: 121552
Yes, you can do that with Spring Integration.
Inbound Channel Adapters (for various target protocols) indeed can send their messages to the same channel. There you can apply any complex logic from the Service Activator. Or add a Router to send different messages to different downstream flows.
On the output you can use a PublishSubscribeChannel
to deliver the same message to different outputs - Outbound Channel Adapters.
We might not have such a sample, but here is an existing set: https://github.com/spring-projects/spring-integration-samples
Upvotes: 1