Page Edited :
CAMEL :
Advanced configuration of CamelContext using Spring
Advanced configuration of CamelContext using Spring has been edited by Claus Ibsen (Jun 12, 2009). Content:Advanced configuration of CamelContext using SpringWhen using Spring the CamelContext can be pre configured based on defined beans in spring XML and/or system properties. What can be configuredThe following functions can be configured: Camel will configure these functions by doing a lookup in the Spring bean registry to find beans of the given type The following list all requires at most 1 beans defined. If there are more than 1 bean of this type, then Camel will not use it.
And the following options have support for any number of beans defined.
Adding container wide interceptorsImagine that you have multiple CamelContext and you want to configure that they all use the same container wide interceptor. How do we do that? Well we can leverage the fact that Camel can auto detect and use custom interceptors. So what we simply do is to define our interceptor in the spring xml file. The sample below does this and also define 2 camel contexts. The sample is based on unit test. TODO: snippet XML e1 Okay lets build our interceptor to simply count the number of interceptions. This is quite easy as we can just implement this logic in our implementation directly as the code below illustrates: TODO: snippet java e1 See Also |
Unsubscribe or edit your notifications preferences