2 Replies Latest reply on Jan 13, 2012 9:20 AM by futuredan

    How do I get a CamelContext from a standalone app?

    futuredan

      I would like to have access to the CamelContext for management tasks from a standalone Java application.

      Is this possible?

      All of the examples I have seen with DefaultCamelContext instantiate it with 'new DefaultCamelContext()' which, I believe, means that it is accessing the context from within Camel.

      I'd like to get access externally.

        • 1. Re: How do I get a CamelContext from a standalone app?
          davsclaus

          Can you tell a bit more what you mean?

           

          Camel offers JMX capabilities, so you can access the CamelContextMBean.

          • 2. Re: How do I get a CamelContext from a standalone app?
            futuredan

            I was hoping to have access to org.apache.camel.CamelContext from my standalone app so that I could call CamelContext.addRoutes( RouteBuilder ).

             

            Also, I would like to manipulate the properties used by a 'camel-context.xml' that are defined in a osgix:cm-properties section.

             

            I think I have the second piece working through JMX using 'osgi.compendium:service=cm', but it's a little convoluted (although that may be just how it is).

             

            Where is the CamelContextMBean?

            I tried looking through JVisualVM and found some MBeans with type 'org.apache.camel.management.mbean.ManagedCamelContext'.

            Are those the ones to which you were referring?