1 2 Previous Next 20 Replies Latest reply on Sep 26, 2011 9:30 AM by Keith Babo

    Accessing JMS queue from SwitchYard

    Boris Belovic Newbie

      Hello,

       

      I've read that SwitchYard can access large set of endpoints -  all endpoints supported in Apache Camel are accessible from SwitchYard. One of these endpoints are JMS queues.

       

      I tried to configure SwitchYard service to access JMS queue (queue is deployed on AS6).

       

      Here is the switchyard.xml file

       

      <?xml version="1.0" encoding="UTF-8"?>

      <switchyard xmlns="urn:switchyard-config:switchyard:1.0"

                  xmlns:swyd="urn:switchyard-config:switchyard:1.0"

                  xmlns:trfm="urn:switchyard-config:transform:1.0"

                  xmlns:bean="urn:switchyard-component-bean:config:1.0"

                  xmlns:soap="urn:switchyard-component-soap:config:1.0"

                  xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"

                  xmlns:camel="urn:switchyard-component-camel:config:1.0"

                  targetNamespace="urn:switchyard-quickstart-demo:orders:0.1.0-SNAPSHOT"

                  name="camel-binding">

          <sca:composite name="camel-binding">

              <sca:service name="GreetingService" promote="GreetingService">

                  <camel:binding.camel configURI="jms:OrderQueue_XXX?connectionFactory=ConnectionFactory">               

                  </camel:binding.camel>

              </sca:service>

          </sca:composite>

      </switchyard>

       

      configUri attribute has the same format as in JMS component in Camel.

       

      But when I deployed my srevice I've got exception saying:

       

      Caused by: java.lang.RuntimeException: org.apache.camel.FailedToCreateRouteException: Failed to create route GreetingService-[jms:OrderQueue_XXX?connectionFactory=ConnectionFactory]: Route[[From[jms:OrderQueue_XXX?connectionFactory=ConnectionF... because of Failed to resolve endpoint: jms://OrderQueue_XXX?connectionFactory=ConnectionFactory due to: Could not find a suitable setter for property: connectionFactory as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: javax.jms.ConnectionFactory with value ConnectionFactory

          at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:66) [:0.1.0-SNAPSHOT]

          at org.switchyard.component.camel.deploy.CamelActivator.createInboundHandler(CamelActivator.java:242) [:0.1.0-SNAPSHOT]

          ... 56 more

       

      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route GreetingService-[jms:OrderQueue_XXX?connectionFactory=ConnectionFactory]: Route[[From[jms:OrderQueue_XXX?connectionFactory=ConnectionF... because of Failed to resolve endpoint: jms://OrderQueue_XXX?connectionFactory=ConnectionFactory due to: Could not find a suitable setter for property: connectionFactory as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: javax.jms.ConnectionFactory with value ConnectionFactory

          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165) [:2.6.0]

          at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:701) [:2.6.0]

          at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1623) [:2.6.0]

          at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:649) [:2.6.0]

          at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:654) [:2.6.0]

          at org.switchyard.component.camel.InboundHandler.<init>(InboundHandler.java:64) [:0.1.0-SNAPSHOT]

          ... 57 more

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jms://OrderQueue_XXX?connectionFactory=ConnectionFactory due to: Could not find a suitable setter for property: connectionFactory as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: javax.jms.ConnectionFactory with value ConnectionFactory

          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:449) [:2.6.0]

          at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47) [:2.6.0]

          at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:175) [:2.6.0]

          at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110) [:2.6.0]

          at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116) [:2.6.0]

          at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72) [:2.6.0]

          at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88) [:2.6.0]

          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:737) [:2.6.0]

          at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:160) [:2.6.0]

          ... 62 more

      Caused by: java.lang.IllegalArgumentException: Could not find a suitable setter for property: connectionFactory as there isn't a setter method with same type: java.lang.String nor type conversion possible: No type converter available to convert from type: java.lang.String to the required type: javax.jms.ConnectionFactory with value ConnectionFactory

          at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:341) [:2.6.0]

          at org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:291) [:2.6.0]

          at org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:225) [:2.6.0]

          at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:200) [:2.6.0]

          at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:449) [:2.6.0]

          at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75) [:2.6.0]

          at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:431) [:2.6.0]

          ... 70 more

       

      I planned to create very simple service, which will monitor JMS queue, read all messages sent in this queue and print them to server console.

       

      Is there some additional configuration needed? Can you provide some example how to access JMS queues?

       

      I also noticed that there is a Spring configuration needed in order to configure Camel itself to access JMS queue. One should provide Camel with Spring XML file with JMS Component definition, this is then read by Camel, it creates SpringCamelContext after this JMS queues are accessible from Camel.

       

      I created this spring-beans.xml with JMSComponent definition, put it into META-INF of my service, but nothing happened

       

      <beans xmlns="http://www.springframework.org/schema/beans"

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xsi:schemaLocation="

             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

             http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

       

        <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"/>

       

        <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">

            <property name="connectionFactory">

              <bean class="org.hornetq.jms.client.HornetQConnectionFactory"/>

          </property>

        </bean>

      </beans>

       

      Is it possible to use SpringCamelContext from SwitchYard (this will allow to use components which need to be configured via Spring) or SwitchYard supports only DefaultCamelContext?

        • 1. Re: Accessing JMS queue from SwitchYard
          Daniel Bevenius Master

          Hi Boris,

           

          I've not tried using Camels JMS Component yet but I'll take a look at this and add some test to see what is required. I've created this jira so that you can track this.

           

          Regards,

           

          /Daniel

          • 2. Re: Accessing JMS queue from SwitchYard
            Keith Babo Master

            Yep, this issue is due to the fact that the context does not contain a reference to the ConnectionFactory bean specified in the config.  One fix would be to wire the JNDI tree into the CamelContext, which should be straightforward.  That way, you should be able to reference a connection factory that's deployed independently.  Perhaps we start there and verify that the JMS component works as expected?

             

            We should be able to get this sorted quickly in 0.2 and provide a SNAPSHOT distribution with the fix for testing.  Thanks for identifying the issue!

            • 3. Re: Accessing JMS queue from SwitchYard
              Raul Martin Newbie

              Hi all,

               

              I'm trying to configure Switchyard/Camel component for reading a remote queue, on a Weblogic server. How could it be configured? Is it possible to define a camel configuration file (spring) so it defines the required connection factory? Or.. should I define a connection factory on JBoss in order to configure the connection (and reference it from JNDI in the camel binding configuration)?

               

              Regards and thanks!

               

              Raúl

              • 4. Re: Accessing JMS queue from SwitchYard
                Keith Babo Master

                Hey,

                 

                It would need to be a connection factory defined in JNDI for this to work with the JMS Camel component in Switchyard.

                 

                cheers,

                keith

                • 5. Re: Accessing JMS queue from SwitchYard
                  Daniel Bevenius Master

                  Hi,

                   

                  I was thinking about this and the new CDI integration that was recently added to the Camel Component. With this it should be possible to add a component like you can in a Camel Spring xml. You should be able to do something like this:

                   

                  import javax.enterprise.context.ApplicationScoped;
                  import javax.enterprise.inject.Produces;
                  import javax.inject.Named;
                  import org.apache.activemq.ActiveMQConnectionFactory;
                  import org.apache.activemq.camel.component.ActiveMQComponent;
                  
                  @ApplicationScoped
                  public class ActiveMQComponentFactory {
                      
                      @Produces @Named ("activemq")
                      public ActiveMQComponent createActiveMQComponent() {
                          final ActiveMQComponent ac = new ActiveMQComponent();
                          final ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
                          factory.setBrokerURL("vm://localhost?broker.persistent=false&amp;broker.useJmx=false");
                          ac.setConnectionFactory(factory);
                          return ac;
                      }
                  
                  }
                  

                  You'd then have to update the 'configURI' in the SwitchYard Camel binding to 'activemq':

                   

                  <camel:binding.camel configURI="activemq://TestQueue"/>
                  
                  

                   

                  I'd still go with Keith's suggestion about using JNDI to lookup the connection factory but thought I'd just throw this out there in case others might have the need to do similar things.

                   

                  Regards,

                   

                  /Daniel

                  • 6. Re: Accessing JMS queue from SwitchYard
                    Raul Martin Newbie

                    Hi again,

                     

                    first of all, thank you for your quick responses. I would go for the first option I think (retrieving the connection factory from JNDI). By the way, which would be the best way to define/store my connection factory in the JNDI when using JBoss AS 7?

                     

                    Please, be as much explicit as you can, I'm a bit blocked

                     

                    Cheers and thanks!,

                    Raúl

                    • 7. Re: Accessing JMS queue from SwitchYard
                      Keith Babo Master

                      I was thinking about this and the new CDI integration that was recently added to the Camel Component. With this it should be possible to add a component like you can in a Camel Spring xml. You should be able to do something like this:

                       

                       

                      Ah, that's a great point.  I think it's an important alternative since this is a common way to configure component/endpoint behavior in Camel. 

                       

                      The advantage of JNDI would be that the connection details could be managed external to the application, which means they can changed based on the environment without having to change the app. 

                       

                      The advantage of the bean approach is that you have a lot more flexibility in setting up the connection factory and also there's not a dependency on a JNDI binding for the factory (which could be advantageous in certain situations I guess).

                      • 8. Re: Accessing JMS queue from SwitchYard
                        Rob Cernich Master

                         

                        The advantage of JNDI would be that the connection details could be managed external to the application, which means they can changed based on the environment without having to change the app. 

                         

                        The advantage of the bean approach is that you have a lot more flexibility in setting up the connection factory and also there's not a dependency on a JNDI binding for the factory (which could be advantageous in certain situations I guess).

                        Couldn't you get the best of both worlds by injecting the JNDI resources? Take Daniel's example and apply http://docs.jboss.org/weld/reference/latest/en-US/html/ee.html#jms to it.

                        • 9. Re: Accessing JMS queue from SwitchYard
                          Keith Babo Master

                          If this worked, it would be awesome.  However, I'm not sure @Resource injection will work without an ENC.  I will definitely test it out though!  :-)

                          Couldn't you get the best of both worlds by injecting the JNDI resources? Take Daniel's example and apply http://docs.jboss.org/weld/reference/latest/en-US/html/ee.html#jms to it.

                          • 10. Re: Accessing JMS queue from SwitchYard
                            Daniel Bevenius Master

                            By the way, which would be the best way to define/store my connection factory in the JNDI when using JBoss AS 7?

                            I've only referenced the HornetQ connection factory as of yet. Let me investigate this and get back to you.

                             

                            Regards,

                             

                            /Daniel

                            • 11. Re: Accessing JMS queue from SwitchYard
                              Raul Martin Newbie

                              Hi Daniel, many thanks.

                               

                              In the meanwhile, I decided to start from the very beginning, trying to consume messages from the default connection factory deployed in JBoss AS 7 (HornetQ), instead of from a remote Weblogic server. Modifying the working quickstart "camel-binding", I modified the configUri in this way:

                              <camel:binding.camel configURI="jms://GreetingServiceQueue?connectionFactory=#ConnectionFactory"/>

                               

                              When I try to deploy it in Switchyard (switchyard-as7-0.2), I'm getting some dependency errors like this:

                               

                              09:18:54,781 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "switchyard-quickstarts-camel-binding-0.3.0-SNAPSH

                              OT.jar"

                              09:18:54,906 INFO  [org.jboss.weld] (MSC service thread 1-3) Processing CDI deployment: switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT.jar

                              09:18:55,046 INFO  [org.jboss.weld] (MSC service thread 1-1) Starting Services for CDI deployment: switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT

                              .jar

                              09:18:55,140 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900 1.1.2 (AS7)

                              09:18:55,156 INFO  [org.switchyard] (MSC service thread 1-1) Deploying SwitchYard application 'switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT.jar

                              '

                              09:18:55,171 INFO  [org.jboss.weld] (MSC service thread 1-4) Starting weld service

                              09:18:55,625 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class org.apache.camel.component.jms.JmsComponent in Module "org.apac

                              he.camel.jms:2.8.0" from local module loader @12a3793 (roots: D:\switchyard-as7-0.2\modules): org.jboss.modules.ModuleLoadError: Module org.apache.cam

                              el.core:main is not found

                                      at org.jboss.modules.ModuleLoadException.toError(ModuleLoadException.java:78)

                                      at org.jboss.modules.Module.getPaths(Module.java:1104)

                                      at org.jboss.modules.Module.loadModuleClass(Module.java:583)

                                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183)

                                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

                                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

                                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

                                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

                                      at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_24]

                                      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [:1.6.0_24]

                                      at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_24]

                               

                               

                              After solving several of them, I've managed to deploy the service successfully. The problema now is that, when I put a message in the Queue GreetingServiceQueue, It seems to be processed, but a null pointer exception is thrown.

                               

                               

                              09:35:46,859 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "switchyard-quickstarts-camel-binding-0.3.0-SNAPSH

                              OT.jar"

                              09:35:46,953 INFO  [org.jboss.weld] (MSC service thread 1-2) Processing CDI deployment: switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT.jar

                              09:35:47,015 INFO  [org.jboss.weld] (MSC service thread 1-2) Starting Services for CDI deployment: switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT

                              .jar

                              09:35:47,093 INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900 1.1.2 (AS7)

                              09:35:47,109 INFO  [org.switchyard] (MSC service thread 1-2) Deploying SwitchYard application 'switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT.jar

                              '

                              09:35:47,125 INFO  [org.jboss.weld] (MSC service thread 1-3) Starting weld service

                              09:35:47,703 INFO  [org.switchyard] (MSC service thread 1-1) Starting SwitchYard service

                              09:35:48,265 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] (MSC service thread 1-1) Found 3 packages with 14 @Converter classe

                              s to load

                              09:35:48,328 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-1) Loaded 153 core type converters (total 153 type con

                              verters)

                              09:35:48,328 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-1) Loaded additional 0 type converters (total 153 type

                              converters) in 0.000 seconds

                              09:35:49,593 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Apache Camel 2.8.0 (CamelContext: camel-2) is starting

                              09:35:49,593 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) JMX enabled. Using ManagedManagementStrategy.

                              09:35:49,625 WARN  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Cannot find needed classes for JMX lifecycle strategy. Needed

                              class is in spring-context.jar using Spring 2.5 or newer (spring-jmx.jar using Spring 2.0.x). NoClassDefFoundError: org/springframework/jmx/export/met

                              adata/JmxAttributeSource

                              09:35:49,640 WARN  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Cannot use JMX. Fallback to using DefaultManagementStrategy (n

                              on JMX).

                              09:35:49,656 INFO  [org.apache.camel.impl.converter.AnnotationTypeConverterLoader] (MSC service thread 1-1) Found 3 packages with 14 @Converter classe

                              s to load

                              09:35:49,671 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-1) Loaded 153 core type converters (total 153 type con

                              verters)

                              09:35:49,687 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-1) Loaded additional 0 type converters (total 153 type

                              converters) in 0.000 seconds

                              09:35:49,687 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Total 0 routes, of which 0 is started.

                              09:35:49,687 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Apache Camel 2.8.0 (CamelContext: camel-2) started in 0.094 se

                              conds

                              09:35:50,390 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-1) Route: {urn:switchyard-quickstart:camel-binding:0.1.0}Greeting

                              Service-[jms://GreetingServiceQueue?connectionFactory=#ConnectionFactory] started and consuming from: Endpoint[jms://GreetingServiceQueue?connectionFa

                              ctory=%23ConnectionFactory]

                              09:35:50,500 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 1) Deployed "switchyard-quickstarts-camel-binding-0.3.0-SNAPSHOT.jar"

                               

                               

                              09:36:41,734 ERROR [org.apache.camel.processor.DefaultErrorHandler] (Camel (camel-2) thread #0 - JmsConsumer[GreetingServiceQueue) Failed delivery for

                              exchangeId: ID-arcitel-raulm-2036-1316072148109-1-1. Exhausted after delivery attempt: 1 caught: java.lang.NullPointerException: java.lang.NullPointe

                              rException

                                      at org.switchyard.metadata.java.JavaService.toMessageTypeString(JavaService.java:143) [switchyard-api-0.2.0.jar:0.2.0]

                                      at org.switchyard.metadata.java.JavaService.toMessageType(JavaService.java:130) [switchyard-api-0.2.0.jar:0.2.0]

                                      at org.switchyard.component.camel.SwitchYardProducer.setInputMessageType(SwitchYardProducer.java:155) [switchyard-component-camel-0.2.0.jar:0.

                              2.0]

                                      at org.switchyard.component.camel.SwitchYardProducer.createInOnlyExchange(SwitchYardProducer.java:109) [switchyard-component-camel-0.2.0.jar:0

                              .2.0]

                                      at org.switchyard.component.camel.SwitchYardProducer.createSwitchyardExchange(SwitchYardProducer.java:98) [switchyard-component-camel-0.2.0.ja

                              r:0.2.0]

                                      at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:82) [switchyard-component-camel-0.2.0.jar:0.2.0]

                                      at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) [c

                              amel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318) [camel-core-2.8.0.jar:2.8.0]

                                      at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209) [camel-core-2.8.0.jar:2.8.0]

                               

                               

                               

                              Do you know which could be the cause?

                               

                              Regards and thanks,

                              Raúl

                              • 12. Re: Accessing JMS queue from SwitchYard
                                Daniel Bevenius Master

                                After solving several of them, I've managed to deploy the service successfully. The problema now is that, when I put a message in the Queue GreetingServiceQueue, It seems to be processed, but a null pointer exception is thrown.

                                Which modules did you install?

                                You'll need to have a module named 'org.springframework' as there the Camel JMS component has a dependency on spring.

                                If you are using the SwitchYard release you should see this module in it. You can simply copy it to your servers modules directory.

                                 

                                Could you send me your example and I'll take a closer look at this issue.

                                 

                                Thanks,

                                 

                                /Daniel

                                • 13. Re: Accessing JMS queue from SwitchYard
                                  Raul Martin Newbie

                                  Hi Daniel,

                                   

                                  In fact, I'm using the Switchyard release 0.2 and the spring framework module is there (I think there is a problem with the versioning). The example I'm speking about is the "camel-binding" quickstart, with the only modification of the configURI (I configured jms://GreetingServiceQueue?connectionFactory=#ConnectionFactory), so it waits the message from a JMS queue instead of from a file in the filesystem. In fact, it's the same that the quickstart camel-jms-binding.

                                   

                                  So, my scenario:

                                   

                                  - Switchyard release 0.2

                                  - Start it with standalone-preview configuration

                                  - Create the GreetingServiceQueue queue

                                  - When I try to deploy the modified example, It seems the the module dependencies of camel (or camel jms) module are not ok.

                                  - Solving them, I manage to deploy the service... But when I put a message in GreetingServiceQueue, Switchyard detects it, but it crashes...

                                   

                                  I really don't know where's the problem... I think I followed the instructions step by step...

                                   

                                  Cheers,

                                  Raúl

                                  • 14. Re: Accessing JMS queue from SwitchYard
                                    Daniel Bevenius Master

                                    Hi Raúl,

                                     

                                    I've tried to reproduce this using 0.2 but not been able to. I used the HornetQ client from the 'camel-jms-binding' quickstart to test it.

                                    Did you use that for sending the message to the queue or did you write your own?

                                    I think there might be an issue here and would like to be able to reproduce and fix it.

                                     

                                    When I try to deploy the modified example, It seems the the module dependencies of camel (or camel jms) module are not ok.

                                    I've created this jira which I'll add some more tasks to and fix these issue. Thanks for reporting this!

                                     

                                    Regards,

                                     

                                    /Daniel

                                    1 2 Previous Next