6 Replies Latest reply on Nov 14, 2009 1:53 AM by davsclaus

    Configuring JMS using Camel

    lekkie_lomotayo

      Can anyone show me how to reference a message broker.

       

      I am configuring a camel-context.xml file. I have the ESB message broker listening on port 61616.

       

      Here is part of my context file:

       

      bc provider

       

      What I'd like to know is, what is the right configuration to do in order to access a message broker listening on a remote machine say 172.168.0.5 on port 61616.

       

       

      kr.

        • 1. Re: Configuring JMS using Camel
          davsclaus

          See details at

          http://camel.apache.org/activemq.html

           

          Basically you add the AMQ as a spring bean

           <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
              <property name="brokerURL" value="tcp://somehost:61616"></property>
            </bean>
          

           

          Instead of activemq you have chosen to name it jms, so all you do is

           <bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
              <property name="brokerURL" value="tcp://somehost:61616"></property>
            </bean>
          

           

          • 2. Re: Configuring JMS using Camel
            lekkie_lomotayo

            Thanks. That was quite useful.

             

            I assume the construct  means I have a request queue named requestQueue of type queue and not a queue named queue/requestQueue, please confirm which is correct.

             

            Also, when I tried to install my JMS OSGI bundle it says:

             

            ERROR CommandLineExecutionFailed: org.apache.geronimo.gshell.command.CommandExce

            ption: org.osgi.framework.BundleException: Unresolved constraint in bundle 165:

            package; (package=org.apache.activemq.camel.component)

             

            What feature is missing, I have installed camel-jms and the error is still the same.

            And how can I know which feature is missing for a particular bundle I'd like to install?

             

            kr.

            • 3. Re: Configuring JMS using Camel
              davsclaus

              yeah its correct about the queue name

               

              There is a or a prefix in Camel

               

              You may need to install a {activemq-camel} or {camel-activemq} feature or whats it called. I cant remember.

              • 4. Re: Configuring JMS using Camel
                lekkie_lomotayo

                I did a features/list and non of the 2 exists. The only thing listed is the actimemq which is installed by default.

                 

                Any ideas where and how I can download this?

                 

                Is there a maven download option, if yes how do I download this?

                • 5. Re: Configuring JMS using Camel
                  davsclaus

                  Is bundle 165 you own application bundle?

                   

                  You may have to add OSGi imports in the MANIFEST.MF file to tell it that you need to import that class since you use it in the spring xml file. Yeah OSGi is really nit picking about imports/exports visibility. Which IMHO is a curse but also a blessing in some more rare cases.

                  • 6. Re: Configuring JMS using Camel
                    njiang

                    Please run this command in your ESB console

                    osgi/install mvn:org.apache.activemq/activemq-camel/5.3.0.3-fuse
                    

                     

                    ESB will download the bundle and install it for you.