PDA

View Full Version : Channel interceptor for synchronous reply channels



dimo.velev
Dec 11th, 2009, 11:27 AM
Hello,

is there any way to configure channel interceptors for the responses of a synchronous call? Currently we are calling them manually but it would be great if it were possible to configure the interceptors in xml.

Thank you,
Dimo

Mark Fisher
Dec 11th, 2009, 11:54 AM
Can you describe what you mean (or show some code) when you say, you are "calling them manually"?

dimo.velev
Dec 11th, 2009, 04:35 PM
Hi Mark,

this is how I would configure a channel interceptor in XML:
--cut--
<int:channel id="aChannel">
<int:interceptors>
<bean class="org.springframework.integration.transformer.Messag eTransformingChannelInterceptor">
<constructor-arg ref="anUnmarshallingTransformer" />
</bean>
</int:interceptors>
</int:channel>
--cut--
Unfortunately, I can not find similar way to configure an interceptor for the temporary response channel.
By manually I mean we have implemented a service activator which forwards the messages to the actual channel and invokes a list of configured interceptors after receiving the response:
--cut--
Message<?> response = messageChannelTemplate.sendAndReceive(request, actualChannel);
// invoke interceptors on the response
--cut--
Is there any way to configure the interceptors as in the first snippet?

Best regards,
Dimo