Azure / amqpnetlite

AMQP 1.0 .NET Library
Apache License 2.0
401 stars 143 forks source link

Help on removing client-side buffer #464

Closed felipegiacomozzi closed 3 years ago

felipegiacomozzi commented 3 years ago

Hello,

Reading the ActiveMQ docs there's a way to remove the client side buffer by setting consumerWindowSize to 0 (https://activemq.apache.org/components/artemis/documentation/latest/flow-control.html). Looking at the amqpnetlite library I couldn`t find anything like that config. I tried the SetCredit method with value 1 or setting the BufferManager to a small byte size ( 128 bytes) but the client still cached messages.

Is there a way to accomplish this?

Thanks for the help.

xinchen10 commented 3 years ago

The library only supports credit based link flow control. I think you can get the same behavior by using CreditMode.Manual in SetCredit method. That means you would need to call SetCredit every time before you call Receive to get messages.

felipegiacomozzi commented 3 years ago

Setting the CreditMode to Manual worked. Thanks for the help @xinchen10