ajaxon
ajaxon

Reputation: 686

How create functionality of servlet filter using Camel

I need to have a route be the first and last that is executed the same as you would get using a servlet filter. Is there any way in Camel to do this so I have access to the exchange? Or possibly a way to have onCompletion only execute once right before the response is built?

Upvotes: 0

Views: 769

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55540

The on completion has a BeforeConsumer mode which you can use to do stuff just before the consumer writes back the response: http://camel.apache.org/oncompletion.html

And for in the start of the route, then use interceptFrom, or an event listener, or route policy or something else. There is several ways with Camel.

Upvotes: 1

Related Questions