Skip to content

Commit 7eee614

Browse files
authored
add reconnect timeout (#167)
1 parent bf8efa7 commit 7eee614

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

sdk/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>software.amazon.awssdk.crt</groupId>
4444
<artifactId>aws-crt</artifactId>
45-
<version>0.13.1</version>
45+
<version>0.13.2</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>junit</groupId>

sdk/src/main/java/software/amazon/awssdk/iot/AwsIotMqttConnectionBuilder.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,19 @@ public AwsIotMqttConnectionBuilder withTimeoutMs(int timeoutMs) {
263263
return this;
264264
}
265265

266+
/**
267+
* Configures the minimum and maximum reconnect timeouts.
268+
*
269+
* The time between reconnect attempts will start at min and multiply by 2 until max is reached.
270+
*
271+
* @param minTimeoutSecs The timeout to start with
272+
* @param maxTimeoutSecs The highest allowable wait time between reconnect attempts
273+
*/
274+
public AwsIotMqttConnectionBuilder withReconnectTimeoutSecs(long minTimeoutSecs, long maxTimeoutSecs) {
275+
this.config.setReconnectTimeoutSecs(minTimeoutSecs, maxTimeoutSecs);
276+
return this;
277+
}
278+
266279
/**
267280
* Configures the common settings for the socket to use for connections created by this builder
268281
*

0 commit comments

Comments
 (0)