We are looking for developing a thin framework for mediation using spring integration. Depending upon the invoked service, we use different transports (amqp, http or in java call using service activator). We do not want the client to be aware of the underlying infrastructure and want to abstract out these. So we were planning to use a Gateway as an entry point.
While doing so, we do not want the client code to specify the request channel, reply channel,timeouts etc. and want to control all these with in our frame work.
Also, we would like to want to add few header information to messages originating through these gateway, but do not want clients to add headers to keep the configuration very simple.
Our first choice was to use the
But the gateway gives way too many options to the client we want to keep it very simple some thing like
<int:gateway id="someService" service-interface="org.example.service" default-request-channel="serviceInputChannel">
<int:method name="someMethod" reply-timeout="2" request-timeout="200" >
<int:header name="serviceName" value="serviceToBeInvoked"/>
<int:header name="requestor" value="callingService"/>
rest we would want to do behind the scene.
<gateway: service-inferface="org.example.service" method="someMethod" />
I thought of using a GatewayProxyFactoryBean and writing a custom name space similar to GatewayParser , but i donot want to use the parser for setting message headers. May be use a message converter.
Also i am not sure if there is a way to use a custom MessageConverter with GatewayProxyFactoryBean.
Is there a better approach for achieving this rather than writing a name space handler or extending the GatewayProxyFactoryBean?