Skip to content

Commit

Permalink
update crt and use Secs for keep alive (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK authored Jun 17, 2021
1 parent 7db708f commit bf8efa7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>software.amazon.awssdk.crt</groupId>
<artifactId>aws-crt</artifactId>
<version>0.12.8</version>
<version>0.13.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,27 @@ public AwsIotMqttConnectionBuilder withCleanSession(boolean cleanSession) {
}

/**
* Configures MQTT keep-alive via PING messages. Note that this is not TCP
* @deprecated Configures MQTT keep-alive via PING messages. Note that this is not TCP
* keepalive.
*
* @param keepAliveMs How often in milliseconds to send an MQTT PING message to the
* service to keep connections alive
*/
@Deprecated
public AwsIotMqttConnectionBuilder withKeepAliveMs(int keepAliveMs) {
this.config.setKeepAliveMs(keepAliveMs);
this.config.setKeepAliveSecs(keepAliveMs/1000);
return this;
}

/**
* Configures MQTT keep-alive via PING messages. Note that this is not TCP
* keepalive.
*
* @param keepAliveSecs How often in seconds to send an MQTT PING message to the
* service to keep connections alive
*/
public AwsIotMqttConnectionBuilder withKeepAliveSecs(int keepAliveSecs) {
this.config.setKeepAliveSecs(keepAliveSecs);
return this;
}

Expand All @@ -229,8 +242,8 @@ public AwsIotMqttConnectionBuilder withPingTimeoutMs(int pingTimeoutMs) {
}

/**
* Controls timeout value for requests that response is required on healthy connection.
* If a response is not received within this interval, the request will fail as server not receiving it.
* Controls timeout value for requests that response is required on healthy connection.
* If a response is not received within this interval, the request will fail as server not receiving it.
* Applied to publish (QoS>0) and unsubscribe
*
* @param protocolOperationTimeoutMs How long to wait for a request response (in milliseconds) before failing
Expand Down Expand Up @@ -489,6 +502,3 @@ public MqttClientConnection build() {
}
}
}



0 comments on commit bf8efa7

Please sign in to comment.