Hi,Dave Thanks for your reply! My situation was a bit rare base on my project and system architecture. This Client was actually a "server" sitting and always keeps connection with mqtt broker, it sends and receives messages from our database to mqtt broker, and furthermore mqtt broker pushes out to the mobile devices, we don't implement waitForCompletion() as we might need to send a huge amount of messages at the same time, like 200 for example, which without implementing callback method, looks more efficient.
From the source code, base on my understanding, the maxinFlight value is just the size of pending messages list for which a sender thread to handle and push out the message to the mqtt broker. In other word, maxInflight value is only related to memory base on the number of messages set in maxinFlight?
If memory was not an issue(in my project, this client runs on a large server ), does it means I can set this value to a large number?
Thanks again!
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
Dave
From:
Jianing Ren <jianingr@xxxxxxxxxxxx>
To:
"paho-dev@xxxxxxxxxxx"
<paho-dev@xxxxxxxxxxx>
Date:
27/11/2013 02:04
Subject:
[paho-dev] maxInflight
window size in ClientState
Sent by:
paho-dev-bounces@xxxxxxxxxxx
Hi,Paho people,
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.
Thanks in advance,guys.
Much appreciated.
Regards,
Johnny Ren.
This email has been processed by SmoothZap - www.smoothwall.net
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
_______________________________________________ paho-dev mailing list paho-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/paho-dev
This email has been processed by SmoothZap - www.smoothwall.net
|