0

I'm using Java Paho MQTT client in my application and I have set the maximum inflight messages to 15 and I'm publishing messages using qos 1.

The problem that I'm having is that sometimes the broker is dropping the messages and therefore is not sending an acknowledgement to the client, which keeps the dropped message in the inflight queue and will keep it forever since it will not be able to get the acknowledgement from the broker.

When I reach 15 messages in this situation, my client stops publishing because it is waiting for the acknowledgement that it will never receive.

Is there a way to set a expiration time to the inflight messages so my client does not hang in this situation?

Barbara
  • 213
  • 2
  • 9
  • The client should resend the message if it doesn't receive an acknowledgement from the broker not just sit and wait. Is there a specific reason you set inflight to 15? – hardillb Aug 12 '17 at 07:26
  • Doing some further investigation it seems like my client hangs on the publish method for no apparent reason. It hangs for more than 15 minutes and then throws it throws an exception: org.eclipse.paho.client.mqttv3.MqttException: Timed out while waiting to write messages to the server – Barbara Aug 14 '17 at 18:39
  • 15mins is the TCP timeout, it sounds like the network link between your client and broker is *very* unreliable – hardillb Aug 14 '17 at 18:59

0 Answers0