smolnar82 commented on code in PR #1095:
URL: https://github.com/apache/knox/pull/1095#discussion_r2426707875


##########
gateway-spi/src/main/java/org/apache/knox/gateway/sse/SSEDispatch.java:
##########
@@ -54,8 +55,11 @@ public class SSEDispatch extends ConfigurableDispatch 
implements AsyncDispatch {
 
     protected final HttpAsyncClient asyncClient;
     private static final String TEXT_EVENT_STREAM_VALUE = "text/event-stream";
+    private final boolean asyncSupported;
 
     public SSEDispatch(FilterConfig filterConfig) {
+        GatewayConfig gatewayConfig = (GatewayConfig) 
filterConfig.getServletContext().getAttribute(GatewayConfig.GATEWAY_CONFIG_ATTRIBUTE);
+        this.asyncSupported = gatewayConfig.isAsyncSupported();
         HttpAsyncClientFactory asyncClientFactory = new 
DefaultHttpAsyncClientFactory();

Review Comment:
   I think there should be a check here: `if (asyncSupported)`
   There is no need to create the client if async is not supported.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to