[ 
https://issues.apache.org/jira/browse/KNOX-3198?focusedWorklogId=986988&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-986988
 ]

ASF GitHub Bot logged work on KNOX-3198:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Oct/25 15:44
            Start Date: 13/Oct/25 15:44
    Worklog Time Spent: 10m 
      Work Description: 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.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 986988)
    Time Spent: 0.5h  (was: 20m)

> Check for async supported on SSE requests
> -----------------------------------------
>
>                 Key: KNOX-3198
>                 URL: https://issues.apache.org/jira/browse/KNOX-3198
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 3.0.0
>            Reporter: Tamás Hanicz
>            Assignee: Tamás Hanicz
>            Priority: Minor
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> This is a QoL change for HA and non-HA SSE requests. For every SSE request it 
> should check that async support is turned on. The SSEDispatch is created 
> during the first request so there is no way to give a faster error response 
> to the user. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to