4 Replies Latest reply on Mar 7, 2016 1:45 PM by Marc Anthony Puca

    hornetq -> activemq migration (wildfly 8.2.0 to wildfly 10)

    Marc Anthony Puca Newbie

      Hi everyone

       

      Following migration to new wildfly I have an issue when collecting message count from queue

       

      previous config had an attribute set as

       

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

                  <hornetq-server>

                      <jmx-management-enabled>true</jmx-management-enabled>


      and the code as


                  MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();

       

                  ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(myQ.getQueueName());

                  JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);

                 

                 int count =  queueControl.getMessageCount();

       

      With wildfly 10 I am getting an exception during the new proxy creation.

       

      Is there maybe an attribute to enable jmx in activeq or is the lookup diffierent

       

       

      Thanks

       

      Marc

        • 1. Re: hornetq -> activemq migration (wildfly 8.2.0 to wildfly 10)
          Marc Anthony Puca Newbie

          According to

           

          Wildfly Model Reference

           

          the subsystem should allow the attribute to be set to enable jmx

           

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

                      <server name="default" jmx-management-enabled="true">

           

          but when server starts I get:

           

          14:30:22,211 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)

            at org.jboss.as.server.ServerService.boot(ServerService.java:356)

            at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)

            at java.lang.Thread.run(Thread.java:745)

          Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[392,13]

          Message: WFLYCTL0376: Unexpected attribute 'jmx-management-enabled' encountered. Valid attributes are: 'persistence-enabled, persist-id-cache, persist-delivery-count-before-delivery, id-cache-size, page-max-concurrent-io, scheduled-thread-pool-max-size, thread-pool-max-size, wild-card-routing-enabled, connection-ttl-override, async-connection-execution-enabled, incoming-interceptors, outgoing-interceptors'

           

          Thanks

           

          Marc

          • 2. Re: hornetq -> activemq migration (wildfly 8.2.0 to wildfly 10)
            Justin Bertram Master

            I think you've mistakenly assumed that the "model" corresponds exactly with the XML.  Rather than the model, you should look at the actual XML schema for the subsystem that ships with Wildfly (e.g. <WILDFLY_HOME>/docs/schema/wildfly-messaging-activemq_1_0.xsd).  There you'll see that you should be using this:

             

               <management>

                   <jmx-enabled>true</jmx-enabled>

               </management>

            • 3. Re: hornetq -> activemq migration (wildfly 8.2.0 to wildfly 10)
              Jeff Mesnil Master

              According to WildFly 10.0.0.Final messaging-activemq XSD, the correct syntax is:

               

              <server ...>
                <management jmx-enabled="true" />
              </server/>
              
              • 4. Re: hornetq -> activemq migration (wildfly 8.2.0 to wildfly 10)
                Marc Anthony Puca Newbie

                Thanks guys, silly me!

                Does help when you know where to look, in the end I got the "messageCount" attribute for

                "jboss.as.expr:jms-queue=myQueueName,subsystem=messaging-activemq,server=default"


                Thanks

                Marc