11 Replies Latest reply on Oct 23, 2009 1:03 PM by kbarlow

    Routing in ESB 3.4.0.4

    kbarlow

      Hi,

       

      Does Fuse ESB 3.4 support Java DSL routing?  I don't see it in the documentation but it seems to use the same JBI components as ESB 4.1 which does support DSL routing...

       

      Thanks.

       

      Keith

        • 1. Re: Routing in ESB 3.4.0.4
          davsclaus

          I think by Java DSL routing you refer to Camel as its the one the has this capability.

           

          Yes you can use Camel in ESB 3.x as well.

           

          ESB 3.x and 4.x both works with Camel.

          http://servicemix.apache.org/servicemix-camel.html

           

          ESB 3.x does as well have its own routing engine in the EIP component

          http://servicemix.apache.org/servicemix-eip.html

          • 2. Re: Routing in ESB 3.4.0.4
            kbarlow

            Yes... thanks.  I think that is what I was referring too.

             

            Keith

            • 3. Re: Routing in ESB 3.4.0.4
              kbarlow

              A few more questions if ya don't mind, please:

               

              When routing to a queue in the embedded ActiveMQ instance, you can just route to that queue, correct? You don't need to declare it or use any sort of bind component to connect to it, right?

               

              Also, whats the best way to make a queue in the embedded ActiveMQ instance externally accessible?  Would that be via an HTTP consumer?

               

              Thanks.

               

              Keith

              • 4. Re: Routing in ESB 3.4.0.4
                kbarlow

                For example,  I have written a message (manually) to an ActiveMQ queue named "test.MyQueue".  Its a simple text message with the content "Hello World".

                 

                I wrote the following route to dump it to a file:

                 

                camel-context.xml:

                 

                 

                 

                But this JmsComponent class is not in the camel-route classpath it seems... (i got exceptions when deploying the SA). 

                 

                Wouldn't this class equate to the already deployed internal JMS - i.e. should this be configured with the servicemix-jms-provider?  Should I update the classpath for the service unit or am I not referencing something correctly?

                 

                Thanks.

                 

                Keith

                • 5. Re: Routing in ESB 3.4.0.4
                  kbarlow

                  I turned up DEBUG logging... it's claiming no service unit description... does that mean I need to provide a WSDL with the service definition?

                   

                  INFO  - AutoDeploymentService          - Directory: hotdeploy: Archive changed: processing company-dupmac-sa-1.0-SNAPSHOT.zip ...

                  DEBUG - AutoDeploymentService          - Unpacked archive C:\progress\fuse-esb-3.4.0.4\hotdeploy\company-dupmac-sa-1.0-SNAPSHOT.zip to C:\progress\fuse-esb-3.4.0.4\data\smx\tmp\company-dupmac-sa-1.0-SNAPSHOT.0.tmp

                  DEBUG - AutoDeploymentService          - SA dependencies:

                  DEBUG - DeploymentService              - Moving C:\progress\fuse-esb-3.4.0.4\data\smx\tmp\company-dupmac-sa-1.0-SNAPSHOT.0.tmp to C:\progress\fuse-esb-3.4.0.4\data\smx\service-assemblies\company-dupmac-sa\version_1\install

                  DEBUG - DeploymentService              - Unpack service unit archive C:\progress\fuse-esb-3.4.0.4\data\smx\service-assemblies\company-dupmac-sa\version_1\install\company-dupmac-route-1.0-SNAPSHOT.zip to C:\progress\fuse-esb-3.4.0.4\data\smx\service-assemblies\company-dupmac-sa\version_1\sus\servicemix-camel\company-dupmac-route

                  DEBUG - CamelJbiComponent              - Deploying service unit

                  DEBUG - CamelJbiComponent              - Looking for C:\progress\fuse-esb-3.4.0.4\data\smx\service-assemblies\company-dupmac-sa\version_1\sus\servicemix-camel\company-dupmac-route\camel-context.xml: true

                  DEBUG - CamelJbiComponent              - Service unit deployed

                  INFO  - ServiceAssemblyLifeCycle       - Starting service assembly: company-dupmac-sa

                  INFO  - ServiceUnitLifeCycle           - Initializing service unit: company-dupmac-route

                  DEBUG - CamelJbiComponent              - Initializing service unit

                  DEBUG - ComponentContextImpl           - Component: servicemix-camel activated endpoint: provider : camel:company-dupmac-route-controlBus

                  DEBUG - CamelJbiComponent              - Querying service description for ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus]

                  DEBUG - CamelJbiComponent              - No description found for provider:camel:company-dupmac-route-controlBus

                  DEBUG - WSDL1Processor                 - Endpoint ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus] has no service description

                  DEBUG - CamelJbiComponent              - Querying service description for ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus]

                  DEBUG - CamelJbiComponent              - No description found for provider:camel:company-dupmac-route-controlBus

                  DEBUG - WSDL2Processor                 - Endpoint ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus] has no service description

                  DEBUG - JCAFlow                        - ServiceMix: broadcasting info for org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus]]

                  DEBUG - JMSFlow                        - ServiceMix: broadcasting info for org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service=provider,endpoint=camel:company-dupmac-route-controlBus]]

                  DEBUG - CamelJbiComponent              - Service unit initialized

                  INFO  - ServiceUnitLifeCycle           - Starting service unit: company-dupmac-route

                  DEBUG - CamelJbiComponent              - Starting service unit

                  DEBUG - CamelJbiComponent              - Service unit started

                  INFO  - AutoDeploymentService          - Directory: hotdeploy: Finished installation of archive:  company-dupmac-sa-1.0-SNAPSHOT.zip

                   

                   

                  Thanks.

                   

                  Keith

                   

                  Edited by: kbarlow on Oct 21, 2009 7:07 PM

                  • 6. Re: Routing in ESB 3.4.0.4
                    davsclaus

                    Yes you need to add the activemq bean in the spring XML file otherwise Camel does now recognize it in the route builder.

                     

                    You can do it a bit shorter and also using the AMQComponent which is optimized for AMQ

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

                     

                    And yes you also need camel-jms.jar on the classpath. I am not 100% familiar where you can drop this .jar but I do believe SMX have a lib folder somewhere where you can drop shared .jars.

                     

                    The camel-jms.jar should be the same version of Camel that you are using. So if you use camel 1.6.1 then it should be camel-jms-1.6.1.jar.

                    • 7. Re: Routing in ESB 3.4.0.4
                      davsclaus

                      There is also some documentation here

                      camel-jbi

                       

                      There are links on that page to SMX documentation as well.

                       

                      And documentation at FUSE as well

                      • 8. Re: Routing in ESB 3.4.0.4
                        kbarlow

                        Thanks...  this was quite a help... I looked through the docs referenced and I think I made progress but I do have a question that at I was wondering if you could look at:

                         

                        I followed the OrderProcessing example at:  order-file-processing

                         

                        It takes a slightly different approach than the one suggested (which I thought it might be beneficial to comprehend so I understand how the camel routes interact with endpoints).  They use a file poller and pass the file contents to an orderProcessor route.  To make the connection, they define the targetService attribute of the file poller to point to the from location of the route. 

                         

                        I defined a  element declared in the camel context.)

                         

                        Thanks in advance.

                         

                        Keith

                        • 9. Re: Routing in ESB 3.4.0.4
                          davsclaus

                          Getting the JBI endpoints defined correctly can be tricky.

                           

                          How are you sending to the JMS queue? The error appears for me to be when you try to send to a JMS queue?

                          • 10. Re: Routing in ESB 3.4.0.4
                            gertv

                            L.S.,

                             

                            I think you should be using the targetService attribute instead of the targetUri attribute to get to the endpoint exposed by the camel route.  The targetUri parameter would take a full service uri instead of just the qualified name.

                             

                            Regards,

                             

                            Gert

                            • 11. Re: Routing in ESB 3.4.0.4
                              kbarlow

                              Well it would appear that this worked (changing to targetService)...  I swear to you that is what I started with as that is what is used in the example and it did not work last night.  When I changed it back, it magically went.  I do not know what else, if anything has changed but it appears to be functioning now...

                               

                              INFO  - ExampleCamelRoute              - Exchange[BodyType:org.apache.camel.converter.stream.StreamCacheConverter.SourceCache, Body:");

                                             }

                                        });

                                   }

                               

                              I wasn't sure how to get the endpoint exposed easily so I figured I would just get basic routes running before I moved on to the complicated stuff.  now that this is working... I will move on.

                               

                              Thanks for your help guys.

                               

                              Keith