Hello
I think your config must be like this:
HTML Code:
<channel id="httpMethodRouter"/>
<channel id="out"/>
<http:inbound-gateway request-channel="httpMethodRouter" reply-channel="out" supported-methods="GET,DELETE"
name="/process/{entId}" path="/process/{entId}" payload-expression="#pathVariables.entId"/>
<router input-channel="httpMethodRouter" expression="headers.http_requestMethod">
<mapping value="GET" channel="in1"/>
<mapping value="DELETE" channel="in2"/>
</router>
<channel id="in1"/>
<service-activator input-channel="in1" output-channel="out" ref="service" method="getEntity"/>
<channel id="in2"/>
<service-activator input-channel="in2" output-channel="out" ref="service" method="delete"/>
1. You have only one entry-point with both suported http-methods. Or there may be more, as I understand on your CRUD sample.
2. Now you don't need to copy/paste your gateway config. Principle DRY.
3. Now there is some powerful component from pipelines & filters architecture - router. Look at him as a @Controller in the Spring MVC.
4. And also you have only one output-channel.
Perhaps someday we will implement some http-method-router as nested element for http inbound entry point...
Nevertheless I don't like to have several components with the same name...
if it isn't clear, please, write your questions.
Good luck,
Artem Bilan