2 Replies Latest reply on Feb 26, 2009 6:24 AM by joe.luo

    How can camel endpoints inter-communicated between OSGI bundles ?

    cmoulliard

      Hi,

       

      I would like to know How camel endpoints can communicate each together when they are defined in different routes which are packaged and deployed in separate osgi bundles ? Do we have to use camel-nmr in this case ?

       

      Remark : I don't know if it makes sense to design a solution like this !!

       

      e.g.

       

      Camel - osgi bundle - Importing sales requests

       

      from("file:///sales/input/")

      .to("bean:validate")

      .to("bean:save")

      .to("bean:incentiveCalculation") --> this endpoint corresponds to an endpoint defined in another osgi bundle

       

      Camel - osgi bundle - Incentive calculation

       

      from("bean:incentiveCalculation")

      .to("bean:enrich")

      .to("bean:calculateIncentive")

      .to("bean:saveResult")

       

      Additional question :

       

      - Do the messages will be lost in case of crash during the exchange between osgi bundles ?

      - Is it possible to define the all route (from("file:///") ... . to("bean:saveResult") as participating to a common transaction ?

       

      Regards,

       

      Charles Moulliard

      SOA Architect

      Xpectis

        • 1. Re: How can camel endpoints inter-communicated between OSGI bundles ?
          joe.luo

          The ESB 4 container will take care of loading relevant packages and classes that required to run your Camel route as long as they are already deployed in the container as OSGI bundles. It does not matter if they are spread as multiple bundles.

           

          >Do we have to use camel-nmr in this case ?

          No, you do not. Unless your camel route need to interact with JBI components. But in this case as your example below, I believe you only need camel-core feature and camel-spring feature.

           

          >Do the messages will be lost in case of crash during the exchange between osgi bundles ?

          Unless you are using transaction, the answer is yes.

           

            Is it possible to define the all route (from("file:///") ... .to("bean:saveResult") as participating to a common transaction?

          Please have a look at http://camel.apache.org/transactional-client.html. As for your question, I am not quite sure. Might be someone else could comment on it.

          • 2. Re: How can camel endpoints inter-communicated between OSGI bundles ?
            joe.luo

            just some more information regarding to your last question:

             

            >Is it possible to define the all route (from("file:///") ... to("bean:saveResult") as participating to a common transaction?

             

            the file and ftp endpoints are non-transactional endpoints. So you can not make them transactional. However, you can start a transaction after a non-transactional endpoint. I believe Adrian Trenaman's video webinar Getting Started with FUSE ESB 4 (based on ServiceMix 4) from http://fusesource.com/enterprise-support/online-training/ already covered some of transaction topics.