There is no external API to change the
max inflight window today, this was discussed on a recent thread along
with the idea of a buffered client. A buffered client would enable
messages to be sent when there is no connectivity up to a maximum configurable
amount. This is a reasonable amount of work to implement.
In the meantime there is no reason not to make the max inflight window
configurable - would be handy if you can raise a bug on the Paho bugzilla
so that it can be tracked. The inflight window effects how messages
can be delivered in parallel from the client to the server. The bigger
the window the more state needs to be stored in the client. It will
also be useful for devices that are more constrained and only wish to allow
1 or a small amount of messages to be inflight.
Even without changes there are approaches
to manage the delivery of messages. For instance:
Blocking mode: Send a message and wait
for it to be delivered - typical approach for this is to use the waitForCompletion()
method on the token returned from the publish call
Keep a count of messages in flight and
block when at the limit and release when a delivery completion is notified.
All the best
Jianing Ren <jianingr@xxxxxxxxxxxx>
window size in ClientState
I am wandering if I can set this maxInflight value
in ClientState to a great number, lets say, 10000? If I do so, does it
have any side effect?
Because I have an issue when a large amount of messages
publishes at the same time, I will fail to send out from the 11th one,
as the default maxInflight value was 10.