3 Replies Latest reply on Nov 5, 2009 2:09 PM by Clebert Suconic

    Producer flow control on LargeMessage

    Clebert Suconic Master

      Producer flow control used to be done at the Channel level.

      That used to mean.. as the client was putting packets on the wire, it would block until it has some window available.

      With the recent changes, if you send a 4GiB message, the client could overflow the channel. We need to take credits on each individual packet send. Otherwise you could more data array in memory waiting to be executed at some points.

      The LargeMessage example is currently broken because of that. (Set a big file size, and it will fail).

      https://jira.jboss.org/jira/browse/HORNETQ-206

        • 1. Re: Producer flow control on LargeMessage
          Tim Fox Master

          I fixed this, and now it works with 256MiB message.

          However there seems to be a problem with the large message buffer. If you increase the message size to 2 GiB, you get the following:

           [java] java.lang.IndexOutOfBoundsException
           [java] at org.hornetq.core.client.impl.LargeMessageBufferImpl.checkForPacket(LargeMessageBufferImpl.java:1266)
           [java] at org.hornetq.core.client.impl.LargeMessageBufferImpl.resetReaderIndex(LargeMessageBufferImpl.java:696)
           [java] at org.hornetq.jms.client.HornetQMessage.doBeforeReceive(HornetQMessage.java:1064)
           [java] at org.hornetq.jms.client.HornetQMessageConsumer.getMessage(HornetQMessageConsumer.java:218)
           [java] at org.hornetq.jms.client.HornetQMessageConsumer.receive(HornetQMessageConsumer.java:133)
           [java] at org.hornetq.jms.example.LargeMessageExample.runExample(LargeMessageExample.java:150)
           [java] at org.hornetq.common.example.HornetQExample.run(HornetQExample.java:73)
           [java] at org.hornetq.jms.example.LargeMessageExample.main(LargeMessageExample.java:45)
          
          


          • 3. Re: Producer flow control on LargeMessage
            Clebert Suconic Master

            I couldn't replicate this failure.

            I have been all the way up to 10GiB, and it runs fine.

            I have seen memory warning on the server side though. (since the example plays with a 50MiB Server).

            Maybe I should clean up the buffer on the packets after received, since the packet still in memory when the credit is confirmed?

            I believe also the server will hold packets up to confirmation when delivering to the client.

            Maybe you had an OME during the transmission what caused an issue?