Reputation: 49
This is going to be my second project which is going to be implement by using Spring integration. I am really confident this architecture after the successful release o f my first project .But I have few clarification required to define the flow of External Calls. In my architecture We have multiple call database,web service and cache server and we have defined these flows like in a single flow .
Scenario 1.
channel- >JDBCOutbound -> router ->splitter ->WSOutbound -> Aggregator ->reply channel.
Here all the external service call is execute from a single Gateway. Are these good approach OR can we define separate gate way call as below
Scenario 2.
Seq 1) Gateway ->JDBCOutbound -> router ->reply channel.
Seq 2) Gateway(use the response from Seq 1) ->splitter ->WSOutbound -> Aggregator ->reply channel
Which scenario is best ?
Upvotes: 1
Views: 142
Reputation: 121177
It depends of your requirements.
As you noticed both variants work well. So, from big height it is a matter of taste. But... let's take a look at this like useful or noise function in our project!
Gateway
is designed to distribute business and integration logic between separate layers. From other side the Gateway
approach together with Spring's Autowiring feature allows us have a high-level API to our integration solution.
So, think a bit further if there is really need to expose such a high-level API for the second call.
No reason to divide our configuration so finely if <channel>
and <service-activator>
(or similar) pair is enough to reach the solution!
From other side it's just my opinion. You'll find your own style eventually with experience.
Upvotes: 1