How to use same CamelContext in multiple jar on the same war

前端 未结 2 744
清歌不尽
清歌不尽 2021-01-16 19:10

I\'m using the camel 2.16.2 and I need to use the one CamelContext across multiple jars as I need to have all the Camel Routers in to one CamelContext. So my war will have a

2条回答
  •  时光取名叫无心
    2021-01-16 19:23

    As other guys said, you can't use the same CamelContext across different Jars. Could you explain a little what you want to do?


    IMHO what you want to do is use routes defined in different Jars. So for that you can define a Camel Context and add all the routes from different Jars. Of course your Camel-Context-JAR has to have access to all those jars.

     
      org.apache.camel.spring.example
    
    

    Or class by class

      
            
      
    
      
    

    Or if you are using CDI you can follow this great article https://dzone.com/articles/using-camel-routes-in-java-ee-components

    Reference: http://camel.apache.org/spring.html

提交回复
热议问题