0 Replies Latest reply on Oct 21, 2017 5:43 PM by Robert Ciejek

    Migrating Spring SOAP over JMS from HornetQ (JBoss 7) based messaging to ActiveMQ (WildFly 10)

    Robert Ciejek Newbie

      I Had a JBoss 7 install that had a Spring application that was configured to use SOAP over JMS.

      The intent of this configuration was to place requests on a queue that other JBoss installs could

      see and execute. The same application and JBoss configuration was used on the "master" and

      "slave" JBoss instances.

       

      I am trying now to upgrade to WildFly 10 and I cannot replicate the previous setup. I have updated

      the spring-soapjms.xml for the application to use the ActiveMQ.artemis api and updated the

      standalone-full.xml configuration to use the new ActiveMQ messaging system. Everything deploys

      without errors and I can execute the request without exceptions but the message sits in the queue

      and none of the remote instances read from it.

       

      Below is the original standalone configuration settings that enabled this functionality with JBoss 7 and HornetQ :

      NOTE: this is not hte ocmplete standalone, the rest was the default settings that come with JBoss.

       

      urn:jboss:domain:messaging:1.3          http://www.jboss.org/schema/jbossas/jboss-as-messaging_1_3.xsd

       

      <extension module="org.jboss.as.messaging"/>

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.3">

       

      <resource-adapter-ref resource-adapter-name="hornetq-ra"/>

       

      <connection-factory name="RemoteConnectionFactory">

          <connectors>

              <connector-ref connector-name="netty"/>

          </connectors>

          <entries>

              <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

          </entries>

      </connection-factory>

       

      <pooled-connection-factory name="hornetq-ra">

          <transaction mode="xa"/>

          <connectors>

              <connector-ref connector-name="in-vm"/>

          </connectors>

          <entries>

              <entry name="java:/JmsXA"/>

          </entries>

          <consumer-window-size>0</consumer-window-size>

      </pooled-connection-factory>

       

      <address-setting match="jms.queue.AMSoapJmsRequest">

          <dead-letter-address>jms.queue.AMSoapJmsResponse</dead-letter-address>

          <expiry-address>jms.queue.AMSoapJmsResponse</expiry-address>

          <max-delivery-attempts>1</max-delivery-attempts>

      </address-setting>

       

      <jms-queue name="AMSoapJmsRequest">

          <entry name="jms/AMSoapJmsRequest"/>

          <entry name="java:jboss/exported/jms/AMSoapJmsRequest"/>

      </jms-queue>

       

      <connectors>

          <netty-connector name="netty" socket-binding="messaging"/>

          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

               <param key="batch-delay" value="50"/>

          </netty-connector>

          <in-vm-connector name="in-vm" server-id="0"/>

      </connectors>

       

      <acceptors>

          <netty-acceptor name="netty" socket-binding="messaging"/>

          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

              <param key="batch-delay" value="50"/>

               <param key="direct-deliver" value="false"/>

          </netty-acceptor>

          <in-vm-acceptor name="in-vm" server-id="0"/>

      </acceptors>

       

      <socket-binding name="messaging" port="5445"/>

      <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>

       

      <socket-binding name="messaging-throughput" port="5455"/>

       

       

       

       

       

      These are the new configuration settings for WildFly 10 with ActiveMQ.

       

      urn:jboss:domain:messaging-activemq:1.0 http://www.jboss.org/schema/jbossas/wildfly-messaging-activemq_1_0.xsd

       

      <extension module="org.wildfly.extension.messaging-activemq"/>

       

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">

       

      <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>

       

      <connection-factory name="RemoteConnectionFactory"

                   connectors="http-connector"

                   entries="java:jboss/exported/jms/RemoteConnectionFactory"

                   consumer-window-size="0"/>

       

      <pooled-connection-factory name="activemq-ra"

                   transaction="xa"

                   connectors="in-vm"

                    entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory"

                    consumer-window-size="0"/>

       

      <address-setting name="jms.queue.AMSoapJmsRequest"

                   dead-letter-address="jms.queue.AMSoapJmsResponse"

                   expiry-address="jms.queue.AMSoapJmsResponse"

                   max-delivery-attempts="1" />

       

      <jms-queue name="AMSoapJmsRequest" entries=" java:jboss/exported/jms/AMSoapJmsRequest "/>

       

      <default-bindings context-service="java:jboss/ee/concurrency/context/default"

                       datasource="java:jboss/datasources/ExampleDS"

                       jms-connection-factory="java:jboss/DefaultJMSConnectionFactory"

                       managed-executor-service="java:jboss/ee/concurrency/executor/default"

                       managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"

                       managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

       

                      <netty-connector name="netty" socket-binding="messaging"/>

                      <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                          <param name="batch-delay" value="50"/>

                      </netty-connector>

                      <netty-acceptor name="netty" socket-binding="messaging"/>

                      <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                          <param name="batch-delay" value="50"/>

                          <param name="direct-deliver" value="false"/>

                      </netty-acceptor>

       

              <socket-binding name="messaging" port="5445"/>

              <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>

       

              <socket-binding name="messaging-throughput" port="5455"/>

       

      Which when I restart the server I get these errors:

       

      timestamp:     2017-10-21T16:12:19.702-04:00

      level:         INFO

      category:      org.jboss.as.controller

      thread:        DeploymentScanner-threads - 1

      message:       WFLYCTL0183: Service status report

      WFLYCTL0186:   Services which failed to start:      service jboss.messaging-activemq.default.jms.connection-factory.RemoteConnectionFactory: org.jboss.msc.service.StartException in service jboss.messaging-activemq.default.jms.connection-factory.RemoteConnectionFactory: WFLYMSGAMQ0028: Failed to create connection-factory

      _______________________________________

       

      2017-10-21 14:13:38,794 DEBUG [org.jboss.as.config] (MSC service thread 1-8) VM Arguments: -D[Standalone] -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Duser.country=US -Duser.language=en -Djboss.modules.write-indexes=false -Xmx2560m -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/usr/local/hydra/jboss-server/standalone/log/server.log -Dlogging.configuration=file:/usr/local/hydra/jboss-server/standalone/configuration/logging.properties

      2017-10-21 14:13:41,323 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration

              at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.server.ServerService.boot(ServerService.java:357) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_92]

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[481,18]

      Message: WFLYCTL0377: Unexpected element '{urn:jboss:domain:messaging-activemq:1.0}netty-connector' encountered. Valid elements are: 'replication-master, shared-store-master, connector-service, http-acceptor, broadcast-group, cluster-connection, bindings-directory, replication-slave, shared-store-slave, shared-store-colocated, live-only, address-setting, jms-queue, pooled-connection-factory, large-messages-directory, divert, journal-directory, in-vm-acceptor, replication-colocated, http-connector, discovery-group, remote-acceptor, acceptor, connection-factory, remote-connector, in-vm-connector, legacy-connection-factory, grouping-handler, jms-topic, connector, security-setting, bridge, paging-directory, queue'

              at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:98) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:265) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:135) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:258) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:135) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              at org.wildfly.extension.messaging.activemq.MessagingSubsystemParser_1_0.readElement(MessagingSubsystemParser_1_0.java:609)

              at org.wildfly.extension.messaging.activemq.MessagingSubsystemParser_1_0.readElement(MessagingSubsystemParser_1_0.java:66)

              at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.2.0.Final.jar:1.2.0.Final]

              at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.2.0.Final.jar:1.2.0.Final]

              at org.jboss.as.server.parsing.StandaloneXml_Legacy.parseServerProfile(StandaloneXml_Legacy.java:1103) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.server.parsing.StandaloneXml_Legacy.readServerElement_1_4(StandaloneXml_Legacy.java:448) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.server.parsing.StandaloneXml_Legacy.readElement(StandaloneXml_Legacy.java:135) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:49) [wildfly-server-2.2.0.Final.jar:2.2.0.Final]

              at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.2.0.Final.jar:1.2.0.Final]

              at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.2.0.Final.jar:1.2.0.Final]

              at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123) [wildfly-controller-2.2.0.Final.jar:2.2.0.Final]

              ... 3 more

       

       

      java:jboss/exported/jms/AMSoapJmsRequest