Chuck Rolke created PROTON-1523: ----------------------------------- Summary: [proton c] API unclear how incoming_capacity and max_frame work Key: PROTON-1523 URL: https://issues.apache.org/jira/browse/PROTON-1523 Project: Qpid Proton Issue Type: Bug Components: proton-c Affects Versions: 0.17.0 Reporter: Chuck Rolke
Two settings are available to throttle incoming traffic. These operate in units of bytes: * pn_transport_set_max_frame * pn_session_set_incoming_capacity Suppose a user sets a max_frame to 1 Mbyte and incoming_capacity to 2 Mbytes. How many 200-byte hello-world messages might a user expect to be able to receive before the local incoming-window closes? 10,000? The answer turns out to be 2. The logical disconnect is that the user interface incoming_capacity operates in bytes but the AMQP protocol over the wire operates with an Incoming-Window in frames. In the user's case the API assumes full frames and sets Incoming-Window = (incoming_capacity / max_frame), or 2. When the sending peer sends 200-byte messages the actual incoming capacity is 400 bytes and not 2Mbytes. The rules (AFAICT) are: {noformat} IF (max_size is specified) incoming_window = incoming_capacity / max_size ELSE incoming_window = 2147473647 ENDIF {noformat} Noting: * Incoming capacity is achieved only if the peer sends max_size frames. * If max_frame is not set then the incoming_capacity setting is ignored. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org