Limit max inflight from outside apache client
@@ -21,8 +21,8 @@ public class StaticThrottler implements Throttler {
private final AtomicLong targetX10;
public StaticThrottler(FeedClientBuilderImpl builder) {
- minInflight = 16L * builder.connectionsPerEndpoint * builder.endpoints.size();
- maxInflight = 256 * minInflight; // 4096 max streams per connection on the server side.
+ minInflight = min(16L, builder.maxStreamsPerConnection) * builder.connectionsPerEndpoint * builder.endpoints.size();
+ maxInflight = (long) builder.maxStreamsPerConnection * builder.connectionsPerEndpoint * builder.endpoints.size();
targetX10 = new AtomicLong(10 * maxInflight); // 10x the actual value to allow for smaller updates.
}
