1 Reply Latest reply on Feb 19, 2013 6:57 PM by Yong Hao Gao

    STOMP - address-full-policy

    giles1 Newbie

      Does STOMP work with address-full-policy.  I have a STOMP acceptor setup and the following in hornet-configuration.xml:

       

      <address-settings>

        <address-setting match="jms.queue.testqueue">

            <max-size-bytes>10</max-size-bytes>

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

          </address-setting>

      </address-settings>

       

      <queues>

        <queue name="testqueue">

            <address>jms.queue.testqueue</address>

            <durable>true</durable>

        </queue>

      </queues>

       

      The max size is pretty low.  Using the standard lib's in Java the queue stops accepting about 487 messages in:

       

      Queue queue = (Queue)initialContext.lookup("/queue/testqueue");

      ...

      QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      ...

      MessageProducer producer = session.createProducer(queue);

       

      for (int i=0; i<1000; i++) {

          TextMessage m = session.createTextMessage("test");

          producer.send(m);

          System.out.println("Sent message: " + i + " " + new Date());

         

      }

       

      Sent message: 482 Tue Feb 19 17:51:18 GMT 2013

      Sent message: 483 Tue Feb 19 17:51:18 GMT 2013

      Sent message: 484 Tue Feb 19 17:51:18 GMT 2013

      Sent message: 485 Tue Feb 19 17:51:18 GMT 2013

      Sent message: 486 Tue Feb 19 17:51:18 GMT 2013

      Sent message: 487 Tue Feb 19 17:51:18 GMT 2013

       

      Using stompy and connecting over STOMP, sending the same "test" message I don't get blocked.

       

      from stompy.simple import Client

      stomp = Client(host="localhost",port=61613)

      stomp.connect()

      for i in range(1000):

        stomp.put("test", destination="jms.queue.testqueue")

        print "Sent msg:" + str(i)

       

      Sent msg:993

      Sent msg:994

      Sent msg:995

      Sent msg:996

      Sent msg:997

      Sent msg:998

      Sent msg:999