4 Replies Latest reply on Aug 19, 2019 4:50 AM by ehugonnet

    How to connect your Spring Boot Client to Wildfly 10 ActiveMQ

    Georg Firmberger Newbie

      I am trying to connect to WildFly 10 ActiveMQ with my Spring Boot Application using a Http-Connector.

      In my application.properties I've set:

      spring.activemq.broker-url=http-remoting://sb-s-stage

       

       

      But the following exception is thrown when I'm starting the Application:

       

      Could not refresh JMS Connection for destination 'telematicQueue' - retrying using FixedBackOff{interval=5000, currentAttempts=0, maxAttempts=unlimited}. Cause: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [Htp-Remoting]

       

      The standalone-full.xml of the Wildfly 10.1.0.Final:

       

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
        
      <server name="default">
             
      <security-setting name="#">
                  
      <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
             
      </security-setting>
             
      <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152"

               message-counter-history-day-limit="10"/>
             
      <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
             
      <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                  
      <param name="batch-delay" value="50"/>
             
      </http-connector>
             
      <in-vm-connector name="in-vm" server-id="0"/>
             
      <http-acceptor name="http-acceptor" http-listener="default"/>
             
      <http-acceptor name="http-acceptor-throughput" http-listener="default">
                  
      <param name="batch-delay" value="50"/>
                  
      <param name="direct-deliver" value="false"/>
             
      </http-acceptor>
             
      <in-vm-acceptor name="in-vm" server-id="0"/>
             
      <jms-queue name="as400Buffer" entries="java:/queue/as400Buffer java:/jboss/exported/jms/queue/as400Buffer"/>
             
      <jms-queue name="ediInQueue" entries="java:/queue/ediInQueue java:/jboss/exported/jms/queue/ediInQueue"/>
             
      <jms-queue name="telematicQueue" entries="java:/queue/telematicQueue java:/jboss/exported/jms/queue/telematicQueue"/>
             
      <jms-queue name="telematicOUTQueue" entries="java:/queue/telematicOUTQueue java:/jboss/exported/jms/queue/telematicOUTQueue"/>
             
      <jms-queue name="dispoListQueue" entries="java:/queue/dispoListQueue java:/jboss/exported/jms/queue/dispoListQueue"/>
             
      <jms-queue name="telematicDatasyncQueue" entries="java:/queue/telematicDatasyncQueue java:/jboss/exported/jms/queue/telematicDatasyncQueue"/>
             
      <jms-queue name="printerQueue" entries="java:/queue/printerQueue java:/jboss/exported/jms/queue/printerQueue"/>
             
      <jms-topic name="events" entries="java:/topic/events java:/jboss/exported/jms/topic/events"/>
             
      <jms-topic name="eventsTest" entries="java:/topic/eventsTest java:/jboss/exported/jms/topic/eventsTest"/>
             
      <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
             
      <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
             
      <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
        
      </server>
      </subsystem>

        • 1. Re: How to connect your Spring Boot Client to Wildfly 10 ActiveMQ
          Himanshu Sharma Newbie

          Hi,

           

          I have the same problem. please let me know if you were able to figure out the solution.

           

          Thanks & Regards,

          Himanshu

          • 2. Re: How to connect your Spring Boot Client to Wildfly 10 ActiveMQ
            ehugonnet Apprentice

            You shouldn't be using http-remoting but http for the broker url:

            spring.activemq.broker-url=http://sb-s-stage

            • 3. Re: How to connect your Spring Boot Client to Wildfly 10 ActiveMQ
              Himanshu Sharma Newbie

              Hi ,

               

              After using http , I am getting below error:

               

              2019-08-14 11:36:44,975 33735 [pool-2-thread-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task.

              org.springframework.jms.UncategorizedJmsException: Uncategorized exception occurred during JMS processing; nested exception is javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [http]

              at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)

              at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)

              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:487)

              at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570)

              at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:658)

              at com.product.ArtemisProducer.send(ArtemisProducer.java:20)

              at com.product.ArtemisProducer.sendMessage(ArtemisProducer.java:25)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)

              at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)

              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

              at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

              at java.lang.Thread.run(Unknown Source)

              Caused by: javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Transport scheme NOT recognized: [http]

              at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)

              at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:333)

              at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:346)

              at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)

              at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)

              at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)

              at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)

              ... 17 common frames omitted

              Caused by: java.io.IOException: Transport scheme NOT recognized: [http]

              at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:28)

              at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:185)

              at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:64)

              at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:331)

              ... 22 common frames omitted

              Caused by: java.io.IOException: Could not find factory class for resource: META-INF/services/org/apache/activemq/transport/http

              at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.loadProperties(FactoryFinder.java:98)

              at org.apache.activemq.util.FactoryFinder$StandaloneObjectFactory.create(FactoryFinder.java:60)

              at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:148)

              at org.apache.activemq.transport.TransportFactory.findTransportFactory(TransportFactory.java:182)

              ... 24 common frames omitted