1 Reply Latest reply on Aug 1, 2011 6:50 PM by fuinhaazul

    AS7 JMS configuration

    fuinhaazul

      Hi guys,

       

      Im trying to get the jms server embeded in AS7 to work with outside requests like:

       

       

      Map<String, Object> connectionParams = new HashMap<String, Object>();

                          connectionParams.put(TransportConstants.PORT_PROP_NAME, 5445);

                          connectionParams.put(TransportConstants.HOST_PROP_NAME, "localhost");

       

                          TransportConfiguration transportConfiguration = new TransportConfiguration(

                                              NettyConnectorFactory.class.getName(), connectionParams);

       

       

       

       

      but im always getting :  HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

       

       

       

      in the standalone.xml i added the following lines

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

      <connectors>

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

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

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

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

                      </netty-connector>

                  </connectors>

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

                          </entries>

                      </connection-factory>

                  </jms-connection-factories>

       

       

       

      and

       

      <socket-binding-group name="standard-sockets" default-interface="public">

      ...

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

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

       

       

       

      What im missing? 

       

       

      Maybe there is a documentation to understand this structure? I used to work with activemq before, so im a little bit lost here. I already saw the as7 documentation and the hornetq examples, but is not clear yet.

       

      Thanks

        • 1. Re: AS7 JMS configuration
          fuinhaazul

          Answering my own question.

          After more reading, I saw that hornetq uses acceptors and connectors.  This is what need to be added to standalone.xml to make it work.

           

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

                                        </acceptors>

           

           

          of course, you will need a socket-binding to messaging and messaging-throughput elements.