Closed Shalaka1197 closed 1 year ago
Hi @Shalaka1197,
The equivalent for maxInflight
would be restrictions().sendMaximum(X).
final Mqtt5ConnAck connAck = client.toBlocking().connectWith()
.cleanStart(false) // resume a previous session
.sessionExpiryInterval(30) // keep session state for 30s
.restrictions()
.receiveMaximum(10) // receive max. 10 concurrent messages
.sendMaximum(10) // send max. 10 concurrent messages
.maximumPacketSize(10_240) // receive messages with max size of 10KB
.sendMaximumPacketSize(10_240) // send messages with max size of 10KB
.topicAliasMaximum(0) // the server should not use topic aliases
.sendTopicAliasMaximum(8) // use up to 8 aliases for the most used topics (automatically traced)
.applyRestrictions()
.willPublish()
.topic("demo/topic/will")
// <snip>
.applyWillPublish()
.send();
As for mqttTimeoutInMillis
, this Java client uses granular timeouts for various operations such as socket connect, disconnect, publish etc.. What timeout are you looking for? A general broker response timeout?
@pglombardo I am looking for connection timeout as of now. Please let me know how to configure it.
You can add the following to your client builder code:
.transportConfig()
.mqttConnectTimeout(10, TimeUnit.SECONDS)
.socketConnectTimeout(10, TimeUnit.SECONDS)
.applyTransportConfig()
Also checkout MqttClientTransportConfig
This should be what you're looking for. Let me know.
Hi @Shalaka1197 - Did this help out? If anything remains, let me know otherwise I'll close out this issue eventually.
Thanks for the reply @pglombardo . You can close this now.
Is there any configurational field is present in HiveMQ MQTT client for maxInflight and mqttTimeoutInMillis so that we can pass our own values during client creation ? This fields are present in Paho MQTT client similar I want in HiveMQ MQTT client.