prabathabey 9 years ago
commit f563f95c41

@ -263,11 +263,11 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
@Override
public void run() {
int connectionDuration = MQTTEventAdapterConstants.initialReconnectDuration;
while (!connectionSucceeded) {
try {
MQTTEventAdapterConstants.initialReconnectDuration = MQTTEventAdapterConstants.initialReconnectDuration
* MQTTEventAdapterConstants.reconnectionProgressionFactor;
Thread.sleep(MQTTEventAdapterConstants.initialReconnectDuration);
connectionDuration = connectionDuration * MQTTEventAdapterConstants.reconnectionProgressionFactor;
Thread.sleep(connectionDuration);
startListener();
connectionSucceeded = true;
log.info("MQTT Connection successful");

@ -48,7 +48,7 @@ public class MQTTEventAdapterConstants {
public static final int ADAPTER_CONF_DEFAULT_KEEP_ALIVE = 60000;
public static int initialReconnectDuration = 2000;
public static final int reconnectionProgressionFactor = 4;
public static final int reconnectionProgressionFactor = 2;
public static final String EMPTY_STRING = "";
public static final String GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer refresh_token";

@ -203,10 +203,10 @@ public class XMPPAdapterListener implements Runnable {
@Override
public void run() {
while (!connectionSucceeded) {
int connectionDuration = XMPPEventAdapterConstants.initialReconnectDuration;
try {
XMPPEventAdapterConstants.initialReconnectDuration = XMPPEventAdapterConstants.initialReconnectDuration
* XMPPEventAdapterConstants.reconnectionProgressionFactor;
Thread.sleep(XMPPEventAdapterConstants.initialReconnectDuration);
connectionDuration = connectionDuration * XMPPEventAdapterConstants.reconnectionProgressionFactor;
Thread.sleep(connectionDuration);
startListener();
connectionSucceeded = true;
log.info("XMPP Connection successful");

@ -50,7 +50,7 @@ public class XMPPEventAdapterConstants {
public static final int DEFAULT_TIMEOUT_INTERVAL = 5000;
public static int initialReconnectDuration = 2000;
public static final int reconnectionProgressionFactor = 4;
public static final int reconnectionProgressionFactor = 2;
public static final String DEFAULT = "default";

Loading…
Cancel
Save