fix(gateway): disable the websocket management at vertx level when it is disabled into the gravitee.yaml file
Fixe gravitee-io/issues#4476
@@ -45,6 +45,14 @@ public class GatewayConfiguration implements InitializingBean {
public void afterPropertiesSet() {
this.initShardingTags();
this.initTenant();
+ this.initVertxWebsocket();
+ }
+
+ private void initVertxWebsocket() {
+ // disable the websockets at vertx level here otherwise a static variable will be defined by the creation of HttpServer
+ // into the io.gravitee.node.management.http.vertx.spring.HttpServerSpringConfiguration object during the container bootstrap
+ Boolean websocketEnabled = environment.getProperty("http.websocket.enabled", Boolean.class, false);
+ System.setProperty("vertx.disableWebsockets", Boolean.toString(!websocketEnabled));
}
private void initShardingTags() {
