Sorry, after some more thought, I realized that you would still have your first endpoint definition. The gateway would be an intermediary (rather than using RequestReplyTemplate or sending directly to a channel and then invoking correlator.getResponse()). For example, something more like this:
Then you would invoke it like this:Code:<endpoint input-channel="input" handler-ref="serviceimpl" handler-method="execute" default-output-channel="responses"/> <gateway id="serviceGateway" target-channel="input" response-channel="responses"/>
Since this would be backed by a ProxyFactoryBean, you could also provide an interface for the proxy (other than the default MessageHandler):Code:Message response = serviceGateway.handle(message);
In that case, the code would be using the regular argument and return value of that interface, while the gateway proxy converts to and from Messages.Code:<gateway id="serviceGateway" interface="com.foo.SomeService" target-channel="input" response-channel="responses"/>
What do you think?
-Mark


Reply With Quote
