1 2 Previous Next 18 Replies Latest reply on Jun 4, 2012 11:49 AM by Jeff Mesnil

    HornetQ Stomp acceptor configuration in JBoss AS 7?

    Michael Justin Novice

      Hello,

       

      Will Stomp be supported in JBoss AS 7? I have found that the JBoss AS 7 configuration file uses a new format so I am not sure how to test it in the current Beta3 of JBoss AS, which seems to include HornetQ 2.1.2.Final.

       

      Regards

        • 1. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
          Clebert Suconic Master

          You should be able to add an acceptor on the jboss-as.xml (whatever the name is) under the hornetq session as you would on hornetq-configuration.xml

           

           

          JBoss As has a single XML, but our configuration part was just embedded on the main XML. You should see no difference. Anything other than that will be a bug that will need to be fixed.

          • 2. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
            Michael Justin Novice

            Hi Clebert,

             

            Today I tried to configure AS 7 for HornetQ / Stomp and found that the configuration changed significantly.

             

            As an example here are the Netty configuration entries.

             

            In HornetQ, the Netty acceptors are configured specifiying the factory class, host and port

             

              <acceptor name="netty">
                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                 <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                 <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
              </acceptor>
             
              <acceptor name="netty-throughput">
                 <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                 <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>
                 <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
                 <param key="batch-delay" value="50"/>
                 <param key="direct-deliver" value="false"/>
              </acceptor>

             

            while in standalone.xml (AS 7) it is using a simpler entry with a socket-binding parameter:

             

                                <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>

             

            The docs at https://docs.jboss.org/author/display/AS7/Messaging+configuration point to the HornetQ docs for details but I guess that this is still work in progress?

             

            Many thanks in advance,

            Michael Justin

            • 3. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
              Michael Justin Novice

              Hi Clebert,

               

              In the final AS 7 version documentation (https://docs.jboss.org/author/display/AS7/Messaging+configuration) there is still no configuration help for Stomp and the format is changed (see my previous answer), should I submit an issue tracker entry?

               

              Greetings

              Michael

              • 5. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                Andy Taylor Master

                ive never tried it clebert/michael, but there is a custom connector type which probably can be used. As to it being simpler in HQ, its meant to be the other way round in AS7, ie a de typed config, teh AS7 docs will have mor eon that

                • 6. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                  Kesav Kumar Kolla Newbie

                  Any updates on it?  I'm currently using stomp+ws connector for all my UI needs.  I want to migrate to AS7 but don't know how to configure stomp in AS7.

                  • 7. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                    Alexandre Gattiker Newbie

                    I tried the exact same configuration in AS7 as in AS6 and it works (at least I can connect).

                     

                    <acceptor name="stomp-acceptor">

                      <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                      <param key="protocol" value="stomp" />

                      <param key="port" value="61613" />

                    </acceptor> 

                    • 8. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                      Ulrich Kriegel Newbie

                      Where did you put that sniplet in the standalone-preview.xml.

                       

                      Thanks in advance

                       

                      --ulrich

                      • 10. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                        Michael Justin Novice

                        Hi Clebert,

                         

                        this is the HornetQ section in standalone.xml of AS 7.1.1.Final, I have tried to add a Stomp acceptor based on code above, but still the broker fails to start with a configuration parse error.

                         

                        I would like to use Stomp in AS 7 but failed to find the correct elements for adding a Stomp connector/acceptor.

                         

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

                                    <hornetq-server>

                                        <persistence-enabled>true</persistence-enabled>

                                        <journal-file-size>102400</journal-file-size>

                                        <journal-min-files>2</journal-min-files>

                                        <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>

                         

                                        <security-settings>

                                            <security-setting match="#">

                                                <permission type="send" roles="guest"/>

                                                <permission type="consume" roles="guest"/>

                                                <permission type="createNonDurableQueue" roles="guest"/>

                                                <permission type="deleteNonDurableQueue" roles="guest"/>

                                            </security-setting>

                                        </security-settings>

                                        <address-settings>

                                            <!--default for catch all-->

                                            <address-setting match="#">

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

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

                                                <redelivery-delay>0</redelivery-delay>

                                                <max-size-bytes>10485760</max-size-bytes>

                                                <address-full-policy>BLOCK</address-full-policy>

                                                <message-counter-history-day-limit>10</message-counter-history-day-limit>

                                            </address-setting>

                                        </address-settings>

                                        <jms-connection-factories>

                                            <connection-factory name="InVmConnectionFactory">

                                                <connectors>

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

                                                </connectors>

                                                <entries>

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

                                                </entries>

                                            </connection-factory>

                                            <connection-factory name="RemoteConnectionFactory">

                                                <connectors>

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

                                                </connectors>

                                                <entries>

                                                    <entry name="RemoteConnectionFactory"/>

                                                    <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>

                                            </pooled-connection-factory>

                                        </jms-connection-factories>

                                        <jms-destinations>

                                            <jms-queue name="testQueue">

                                                <entry name="queue/test"/>

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

                                            </jms-queue>

                                            <jms-topic name="testTopic">

                                                <entry name="topic/test"/>

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

                                            </jms-topic>

                                        </jms-destinations>

                                    </hornetq-server>

                                </subsystem>

                        • 11. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                          Yong Hao Gao Master

                          Take a look at comment 7 (by Alexandre). it should work for you.

                          • 12. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                            Michael Justin Novice

                            With this configuration

                             

                             

                                            <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>

                                                <netty-acceptor name="stomp-acceptor">

                                                </netty-acceptor> 

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

                                               

                                                <acceptor name="stomp-acceptor">

                                                <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                                                <param key="protocol" value="stomp" />

                                                <param key="port" value="61613" />

                                                </acceptor>

                                               

                                            </acceptors>

                             

                            I have this error:

                             

                             

                             

                             

                            C:\Java\jboss-as-7.1.1.Final\bin>standalone -c standalone-full.xml

                            Calling "C:\Java\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

                            ===============================================================================

                             

                              JBoss Bootstrap Environment

                             

                              JBOSS_HOME: C:\Java\jboss-as-7.1.1.Final

                             

                              JAVA: C:\Program Files\Java\jdk1.6.0_07\bin\java

                             

                              JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms64M -Xmx51

                            2M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.se

                            rver.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.war

                            ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.c

                            onfig=standalone.xml

                             

                            ===============================================================================

                             

                            10:08:20,156 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

                            10:08:20,327 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

                            10:08:20,374 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" sta

                            rting

                            10:08:21,092 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boo

                            t: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS01

                            4676: Failed to parse configuration

                                    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(Xm

                            lConfigurationPersister.java:141) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Fin

                            al]

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

                            -as-server-7.1.1.Final.jar:7.1.1.Final]

                                    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractContr

                            ollerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]

                                    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

                            Caused by: java.lang.IllegalArgumentException: newValue is null

                                    at org.jboss.dmr.ModelNode.set(ModelNode.java:458) [jboss-dmr-1.1.1.Fina

                            l.jar:1.1.1.Final]

                                    at org.jboss.as.messaging.MessagingSubsystemParser.processAcceptors(Mess

                            agingSubsystemParser.java:871)

                                    at org.jboss.as.messaging.MessagingSubsystemParser.processHornetQServer(

                            MessagingSubsystemParser.java:235)

                                    at org.jboss.as.messaging.MessagingSubsystemParser.processHornetQServers

                            (MessagingSubsystemParser.java:178)

                                    at org.jboss.as.messaging.MessagingSubsystemParser.readElement(Messaging

                            SubsystemParser.java:159)

                                    at org.jboss.as.messaging.MessagingSubsystemParser.readElement(Messaging

                            SubsystemParser.java:119)

                                    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:1

                            10) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                                    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtende

                            dStreamReaderImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                                    at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(Standalo

                            neXml.java:894) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                    at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(Stand

                            aloneXml.java:330) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.j

                            ava:127) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.j

                            ava:100) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                                    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:1

                            10) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                                    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:6

                            9) [staxmapper-1.1.0.Final.jar:1.1.0.Final]

                                    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(Xm

                            lConfigurationPersister.java:133) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Fin

                            al]

                                    ... 3 more

                             

                            10:08:21,123 FATAL [org.jboss.as.server] JBAS015957: Server boot has failed in a

                            n unrecoverable manner; exiting. See previous messages for details.

                            10:08:21,138 INFO  [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" sto

                            pped in 7ms

                            Drücken Sie eine beliebige Taste . . .

                            • 13. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                              Michael Justin Novice

                              In which part of the configuration have you added this?

                              • 14. Re: HornetQ Stomp acceptor configuration in JBoss AS 7?
                                Jeff Mesnil Master

                                the XML elements are slightly different between HornetQ and AS7 messaging subystem.

                                 

                                Try to add

                                 

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

                                                  <param key="protocol" value="stomp" />

                                               </netty-acceptor>

                                 

                                inside the <acceptors> element in AS7

                                and

                                 

                                        <socket-binding name="messaging-stomp" port="6163"/>

                                 

                                inside the <socket-binding-group>

                                 

                                That should work.

                                1 2 Previous Next