Update pom.xml, AsyncTdMiddleEventBusClient.java, and AsyncTdMiddleEventBusServer.java
This commit is contained in:
parent
2b4962ca6e
commit
8ec51cb57e
2
pom.xml
2
pom.xml
@ -102,7 +102,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.tdlight</groupId>
|
<groupId>it.tdlight</groupId>
|
||||||
<artifactId>tdlight-java</artifactId>
|
<artifactId>tdlight-java</artifactId>
|
||||||
<version>3.169.114</version>
|
<version>3.169.120</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.cavallium</groupId>
|
<groupId>it.cavallium</groupId>
|
||||||
|
@ -72,7 +72,7 @@ public class AsyncTdMiddleEventBusClient extends AbstractVerticle implements Asy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.deliveryOptions = cluster.newDeliveryOpts().setLocalOnly(local);
|
this.deliveryOptions = cluster.newDeliveryOpts().setLocalOnly(local);
|
||||||
this.deliveryOptionsWithTimeout = cluster.newDeliveryOpts().setLocalOnly(local).setSendTimeout(10000);
|
this.deliveryOptionsWithTimeout = cluster.newDeliveryOpts().setLocalOnly(local).setSendTimeout(30000);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mono<AsyncTdMiddleEventBusClient> getAndDeployInstance(TdClusterManager clusterManager, String botAlias, String botAddress, boolean local) throws InitializationException {
|
public static Mono<AsyncTdMiddleEventBusClient> getAndDeployInstance(TdClusterManager clusterManager, String botAlias, String botAddress, boolean local) throws InitializationException {
|
||||||
@ -112,7 +112,7 @@ public class AsyncTdMiddleEventBusClient extends AbstractVerticle implements Asy
|
|||||||
this.initTime = System.currentTimeMillis();
|
this.initTime = System.currentTimeMillis();
|
||||||
|
|
||||||
CircuitBreaker startBreaker = CircuitBreaker.create("bot-" + botAddress + "-server-online-check-circuit-breaker", vertx,
|
CircuitBreaker startBreaker = CircuitBreaker.create("bot-" + botAddress + "-server-online-check-circuit-breaker", vertx,
|
||||||
new CircuitBreakerOptions().setMaxFailures(1).setMaxRetries(4).setTimeout(10000)
|
new CircuitBreakerOptions().setMaxFailures(1).setMaxRetries(4).setTimeout(30000)
|
||||||
)
|
)
|
||||||
.retryPolicy(policy -> 4000L)
|
.retryPolicy(policy -> 4000L)
|
||||||
.openHandler(closed -> {
|
.openHandler(closed -> {
|
||||||
@ -146,7 +146,7 @@ public class AsyncTdMiddleEventBusClient extends AbstractVerticle implements Asy
|
|||||||
.getEventBus()
|
.getEventBus()
|
||||||
.request(botAddress + ".isWorking", EMPTY, deliveryOptionsWithTimeout, msg -> {
|
.request(botAddress + ".isWorking", EMPTY, deliveryOptionsWithTimeout, msg -> {
|
||||||
if (msg.succeeded()) {
|
if (msg.succeeded()) {
|
||||||
this.listen().then(this.pipe()).timeout(Duration.ofSeconds(10)).subscribe(v -> {}, future::fail, future::complete);
|
this.listen().then(this.pipe()).timeout(Duration.ofSeconds(30)).subscribe(v -> {}, future::fail, future::complete);
|
||||||
} else {
|
} else {
|
||||||
future.fail(msg.cause());
|
future.fail(msg.cause());
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class AsyncTdMiddleEventBusServer extends AbstractVerticle {
|
|||||||
});
|
});
|
||||||
|
|
||||||
logger.debug("Sending " + botAddress + ".readyToStart");
|
logger.debug("Sending " + botAddress + ".readyToStart");
|
||||||
cluster.getEventBus().send(botAddress + ".readyToStart", EMPTY, cluster.newDeliveryOpts().setSendTimeout(10000));
|
cluster.getEventBus().send(botAddress + ".readyToStart", EMPTY, cluster.newDeliveryOpts().setSendTimeout(30000));
|
||||||
|
|
||||||
var clientDeadCheckThread = new Thread(() -> {
|
var clientDeadCheckThread = new Thread(() -> {
|
||||||
Throwable ex = null;
|
Throwable ex = null;
|
||||||
@ -148,7 +148,7 @@ public class AsyncTdMiddleEventBusServer extends AbstractVerticle {
|
|||||||
.getEventBus()
|
.getEventBus()
|
||||||
.request(botAddress + ".readyToStart",
|
.request(botAddress + ".readyToStart",
|
||||||
EMPTY,
|
EMPTY,
|
||||||
cluster.newDeliveryOpts().setSendTimeout(10000),
|
cluster.newDeliveryOpts().setSendTimeout(30000),
|
||||||
r -> promise.handle(r.mapEmpty())
|
r -> promise.handle(r.mapEmpty())
|
||||||
);
|
);
|
||||||
promise.future().toCompletionStage().toCompletableFuture().join();
|
promise.future().toCompletionStage().toCompletableFuture().join();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user