Hi,

  Is there any way to do consumer-side flow control from Proton C++? I'm 
currently using 0.12.1, but I don't see anything different from what I did 
below even in 0.14.0.

I added the following lines to the example simple_recv.cpp 's on_message() 
handler,

          std::cout << "received; credits now: "
                  << receiver.credit() << std::endl;

        // Drop it down to -1. 0 doesn't stop anything (-1 also doesn't stop 
anything)
        while (receiver.credit() > -1) {
          receiver.flow(-1);
          std::cout << "decremented: credits now: "
                    << receiver.credit() << std::endl;
        }

and get:

...
received; credits now: 9
decremented: credits now: 8
decremented: credits now: 7
decremented: credits now: 6
decremented: credits now: 5
decremented: credits now: 4
decremented: credits now: 3
decremented: credits now: 2
decremented: credits now: 1
decremented: credits now: 0
decremented: credits now: -1
{"sequence"=100}
...

which isn't surprising actually since the receiver starts life at 0 credits and 
receives messages. Anyway, this method doesn't work, is there another way, or 
is the whole concept of link credit meant to be reserved for the implementation?

Thanks,
Jeff

Reply via email to