2 Replies Latest reply on Oct 27, 2009 3:25 PM by clebert.suconic

    Producer flow control

    timfox

      I'm currently implementing producer address limited flow control (almost done locally).

      Basically the idea is this:

      If an address is configured with a max size in AddressSettings, then producer flow will prevent any client producers from sending messages in a way that could cause the amount of data in the address to exceed max size.

      This is done by producers only sending messages as long as they have credits. The credits are borrowed from a pot on the address, if the client has no credits it will block on send().

      We now have on AddressSettings, what I call AddressFullMessagePolicy. This is an enum which can take one of three values:

      DROP
      PAGE
      BLOCK

      If set to DROP, then, when the address is full, any messages received on the server will just be dropped.

      If set to PAGE, when the address is full, any messages will be paged

      if set to BLOCK, when the address is full, clients will block on send(). (Note, the blocking is done on the client side, not the server side)

      Currently, the default behaviour is PAGE.

      Now, I'm thinking perhaps we should change this to BLOCK, we could even configure a default max size for addresses. This would mean, out of the box, we wouldn't be so susceptible to out of memory execeptions, since clients would just block before memory got exhausted.