2 Replies Latest reply on Apr 5, 2011 11:37 AM by Brian L

    Stomp consumer reliability

    Brian L Newbie

      Hello all, I have a problem when I have a simple Apache NMS Stomp client that will connect, create a producer, send the message, create a consumer, receive the message, ACK the message, then close out all the connections. I put it in a while forever loop to see how long it could last.

       

      No matter how many trials I do, it happens to hang up when trying to create a consumer. The number of trials can range anywhere from 1 to 300+

       

      It always fails when it tries to create a consumer on the following line of my code:

       

      consumer = session.CreateConsumer(new Apache.NMS.Stomp.Commands.Queue(queueName), null);
      

       

      I have attached my C# code that also includes the libraries for the NMS stomp client in a visual C# project. Main is located in Test.cs

       

      I am currently using HornetQ 2.2.2 Final attached to JBoss 5.1.0 GA on a Linux server with only 2 modifications to the config files.

      1. Adding stomp-acceptor in the hornetq-config.xml

       

      <acceptor name="stomp-acceptor">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>        
               <param key="protocol" value="stomp" />
               <param key="host" value="${jboss.bind.address:localhost}"/>
               <param key="port" value="61613" />
      </acceptor> 
      
      

      2. Adding queue names in the same hornetq-config.xml

       

      <queues>
               <queue name="exampleA">
                     <address>/queue/exampleA</address>
               </queue>
      
      </queues>
      
      

       

       

      Other than that, everything is using their default configurations.

      If someone would not mind downloading my source code and testing it, it would be appreciated. Main is located in Test.cs

      Thank you