activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [camel] How to user InterceptorProcessors
Date Thu, 19 Apr 2007 18:42:33 GMT
On 4/19/07, dr.jeff <> 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.


class MyInterceptor extends ProcessorDelegate<Exchange> { ...

void process(Exchange exchange) {
   // modify IN
   // modify OUT


View raw message