You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "dr.jeff" <jl...@systechnologies.com> on 2007/04/19 16:40:26 UTC
[camel] How to user InterceptorProcessors
What is the intended usage of interceptors?
Do I get the get the message from exchange.getIn() and, say, modify its
body?
Or should I somehow be putting the modifications into the exchange.getOut()
message?
--
View this message in context: http://www.nabble.com/-camel--How-to-user-InterceptorProcessors-tf3607402s2354.html#a10078648
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: [camel] How to user InterceptorProcessors
Posted by James Strachan <ja...@gmail.com>.
On 4/19/07, dr.jeff <jl...@systechnologies.com> wrote:
>
> What is the intended usage of interceptors?
e.g. using security or transaction interceptors. See the camel-jpa
module for some examples (such as the Jpa based IdempotentConsumer
test case which uses a default transaction interceptor.
We could also use interceptors to do transformations too
> Do I get the get the message from exchange.getIn() and, say, modify its
> body?
Sure if you like
> Or should I somehow be putting the modifications into the exchange.getOut()
> message?
You can do either really. getOut() is only intended for
request-response (InOut) exchange patterns and the out is usually
written by the actual service.
so you could modify the IN before the service is invoked, then modify
the generated OUT after the service has been invoked if you like.
e.g.
class MyInterceptor extends ProcessorDelegate<Exchange> { ...
void process(Exchange exchange) {
// modify IN
processNext(exchange);
// modify OUT
}
--
James
-------
http://macstrac.blogspot.com/