diff --git a/sdk/pom.xml b/sdk/pom.xml index 06fc1d7b4..fadd635c2 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -42,7 +42,7 @@ software.amazon.awssdk.crt aws-crt - 0.12.8 + 0.13.1 junit diff --git a/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java b/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java index b6d8045e7..86c073106 100644 --- a/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java +++ b/sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java @@ -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; } @@ -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 @@ -489,6 +502,3 @@ public MqttClientConnection build() { } } } - - -