}
})
.block());
+
+ HAPROXY
+ .getDockerClient()
+ .killContainerCmd(HAPROXY.getContainerId())
+ .withSignal("HUP")
+ .exec();
+
+
+ Awaitility
+ .await()
+ .atMost(Duration.ofMinutes(10))
+ .until(() -> webClient
+ .get()
+ .uri("/actuator/health")
+ .exchangeToMono(response ->
+ {
+ if (response.statusCode().equals(HttpStatus.OK))
+ {
+ return response
+ .bodyToMono(StatusTo.class)
+ .map(StatusTo::getStatus)
+ .map(status -> status.equalsIgnoreCase("UP"));
+ }
+ else
+ {
+ return Mono.just(false);
+ }
+ })
+ .block());
}
WebClient webClient;
result.getStdout());
BACKEND_1.start();
- // BACKEND_2.start();
- // BACKEND_3.start();
+ BACKEND_2.start();
+ BACKEND_3.start();
}
static Network NETWORK = Network.newNetwork();
"sharding.map",
"/usr/local/etc/haproxy/sharding.map",
BindMode.READ_WRITE)
- .withExposedPorts(8400) // , 8401, 8404, 5555)
+ .withExposedPorts(8400, 8401, 8404)
.withLogConsumer(new Slf4jLogConsumer(log, true).withPrefix("HAPROXY"));
@EqualsAndHashCode
timeout server 10m
timeout http-request 10s
log global
- default-server init-addr none
+ default-server init-addr last,libc,none
global
stats socket ipv4@:8401 level admin
stats socket /var/run/haproxy.sock mode 666 level admin
stats timeout 2m
+resolvers docker
+ parse-resolv-conf
+
frontend stats
bind *:8404
stats enable