Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-645

Implement session flow control independently of transport.capacity

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: proton-j-future
    • Component/s: proton-j
    • Labels:
      None

      Description

      When integrating with any asynchronous IO we are obligated to implement flow control based on the capacity of the Transport.

      Things get especially harder because when you pop bytes in a asynchronous method for after completion:

      e.g. on Netty:

      channel.writeAndFlush(bytes).addListener(new ChannelFutureListener()
      {
      @Override
      public void operationComplete(ChannelFuture future) throws Exception
      {
      transport.pop(bufferSize);
      /// perform process, and dispatch!
      performDispatchEtc();
      if (transport.capacity() > 0)

      { channel.read(); }

      }
      });

      this makes things specially harder as we are eventually losing events or bytes. We could make things work with some hacks (like having recursive loops on the methods for writing and reading)...

      Making Proton-J to work with asynchronous pop is definitely a black art. Instead of working around with recursive workarounds we should provide an easier path. such as plugging SessionFlowController where we could activate / deactivate producers on a server, or use Semaphores on a client where a client could block until things are properly released.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              clebertsuconic Clebert Suconic
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: