3 Replies Latest reply on Jun 5, 2012 3:10 AM by nimo stephan

    Stomp configuration in Jboss as 7

    nimo stephan Master

      I use JAS 7.1.1 (jboss as) with its embeeded hornetq-server. The authentication is made up via standalone.xml within subsystem xmlns="urn:jboss:domain:security:1.1.

       

      HornetQ runs successfully and producing/consuming messages works.

       

      Now, I want to produce, consume messages via Stomp-Websocket. However, I have problems with the setup:

       

      As stated here https://community.jboss.org/thread/167945?start=15&tstart=0,

       

      the only thing I have to do to use Stomp-Websocket it to put this into standalone.xml:

       

      <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="netty-stomp" socket-binding="messaging-stomp">

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

      </netty-acceptor>

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

      </acceptors>

      ...

      <socket-binding name="messaging-stomp" port="61614"/> <!-- 6163 does not work, so I changed it to 61614-->

      ...

       

      Now, I want to connect to  "topic/test":


      <jms-topic name="testQueue">

         <entry name="queue/test"/>

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

      </jms-topic>

       

      At client-side, I included stomp.js and register my stomp client this way:

       

      registerStompClient: function(){

              var url = "ws://localhost:61614/stomp";

              var client = Stomp.client(url);

              client.connect("guest", "guest",stompConnectCallback, stompErrorCallback);

              // client.send("jms.queue.test", {priority: 9}, "Hello, Stomp"); // I do not send or receive anything, I only want to setup connection !

      },

       

      stompConnectCallback: function(){

                  console.log("connected to Stomp-Server!");

      },

             

      stompErrorCallback: function(error){

                  console.log(error);

      },

       

       

      However, when invoking registerStompClient() from the client, my server-console says:

       

      16:30:09,121 ERROR [org.hornetq.core.protocol.stomp.StompProtocolManager] (Old I/O server worker (parentId: 1086920904, [id: 0x40c918c8, localhost/127.0.0.1:61614])) Failed to decode: org.hornetq.core.protocol.stomp.StompException: Invalid STOMP frame: G,E,T,32,/,s,t,o,m,p,32,H,T,T,P,/,1,.,1,13,10,U,p,g,r,a,d,e,:,32,w,e,b,s,o,c,k,e,t,13,10,C,o,n,n,e,c,t,i,o,n,:,32,U,p,g,r,a,d,e,13,10,H,o,s,t,:,32,l,o,c,a,l,h,o,s,t,:,6,1,6,1,4,13,10,O,r,i,g,i,n,:,32,h,t,t,p,:,/,/,l,o,c,a,l,h,o,s,t,:,8,0,8,0,13,10,S,e,c,-,W,e,b,S,o,c,k,e,t,-,K,e,y,:,32,7,8,5,S,2,B,Q,8,Z,6,Q,U,I,P,5,0,u,2,Y,V,H,Q,=,=,13,10,S,e,c,-,W,e,b,S,o,c,k,e,t,-,V,e,r,s,i,o,n,:,32,1,3,13,10,13,10,

          at org.hornetq.core.protocol.stomp.StompDecoder.throwInvalid(StompDecoder.java:566) [hornetq-core-2.2.13.Final.jar:]

          at org.hornetq.core.protocol.stomp.StompDecoder.decode(StompDecoder.java:367) [hornetq-core-2.2.13.Final.jar:]

          at org.hornetq.core.protocol.stomp.StompProtocolManager.handleBuffer(StompProtocolManager.java:170) [hornetq-core-2.2.13.Final.jar:]

          at org.hornetq.core.protocol.stomp.StompConnection.bufferReceived(StompConnection.java:284) [hornetq-core-2.2.13.Final.jar:]

          at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.2.13.Final.jar:]

          at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73) [hornetq-core-2.2.13.Final.jar:]

          at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:367) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:100) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44) [netty-3.2.6.Final.jar:]

          at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181) [netty-3.2.6.Final.jar:]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_01]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_01]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]

       

       

      I have also tried to use <socket-binding name="ws" port="61614"/> but the error is still the same.

       

      My cliient code does not send or receive any message to a queue, hence the stomp-body is null, which is legal. So I do not understand why the STOMP frame is invalid.

       

      What is wrong?