the current_link_credit and delivery_count on a c link instance are not calculated correctly when messages of large size (composed of multiple transfer frames) are received which leads to an inconsistent state between the client and the service.
currently current_link_credit decreases and delivery_count increases on each transfer received, this is wrong, according to the AMQP spec, those two variables should be updated when a message is received instead of a single frame
How to fix:
current_link_credit decreasing and delivery_count increasing should be updated after the whole message is received instead of immediately after a transfer frame is received, see code.
Problem: The service bus service would keep sending messages of large size while the client side there's no credit on the link.
Root cause:
current_link_credit
anddelivery_count
on a c link instance are not calculated correctly when messages of large size (composed of multiple transfer frames) are received which leads to an inconsistent state between the client and the service.current_link_credit
decreases anddelivery_count
increases on each transfer received, this is wrong, according to the AMQP spec, those two variables should be updated when a message is received instead of a single frameHow to fix:
current_link_credit
decreasing anddelivery_count
increasing should be updated after the whole message is received instead of immediately after a transfer frame is received, see code.