...
Camel has a AOP concept in the DSL allowing you do do some custom before and/or after processing when routing an Exchange.
It replaces the intercept
from Camel 1.x that . intercept
was more limited as because it could was a fix only be fixed around a single processor.
...
The AOP supports the following callbacks in which you can use 1..n free of choice:
- before
- after
- afterFinally
The difference between after
and afterFinally
is that afterFinally
is invoked from a finally block so it will always be invoked no matter what, eg also in case of an exception occur.
...
The aop in Java DSL have the following methods:
- around
- aroundFinally
- before
- after
- afterFinally
Using from Spring DSL
In Spring DSL its nearly the same as in the Java DSL however a bit differently
...
The aop in Spring DSL have the following attributes:
- beforeUri
- afterUri
- afterFinallyUri
So in order to do an around we use both the beforeUri
and the afterUri
.