After https://github.com/trinodb/trino-gateway/issues/41, request body can't be accessible via HttpServletRequest in any modules, such as TrinoQueryProperties, routing rules, and gateway itself, because HttpServletRequest input stream(HttpServletRequest.getInputStream()) is consumed already by Jakarta web service framework.
2024-08-26T08:42:06.498+0900 ERROR http-worker-89 io.trino.gateway.ha.router.RuleReloadingRoutingGroupSelector Error opening rules configuration file, using routing group header as default.
java.lang.IllegalStateException: STREAMED
at org.eclipse.jetty.ee10.servlet.ServletApiRequest.getReader(ServletApiRequest.java:1169)
at io.trino.gateway.ha.router.TrinoQueryProperties.processRequestBody(TrinoQueryProperties.java:109)
at io.trino.gateway.ha.router.TrinoQueryProperties.<init>(TrinoQueryProperties.java:103)
at io.trino.gateway.ha.router.RuleReloadingRoutingGroupSelector.findRoutingGroup(RuleReloadingRoutingGroupSelector.java:98)
at io.trino.gateway.ha.handler.RoutingTargetHandler.getBackendFromRoutingGroup(RoutingTargetHandler.java:84)
at io.trino.gateway.ha.handler.RoutingTargetHandler.lambda$getRoutingDestination$0(RoutingTargetHandler.java:64)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at io.trino.gateway.ha.handler.RoutingTargetHandler.getRoutingDestination(RoutingTargetHandler.java:64)
at io.trino.gateway.proxyserver.RouteToBackendResource.postHandler(RouteToBackendResource.java:66)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
After https://github.com/trinodb/trino-gateway/issues/41, request body can't be accessible via
HttpServletRequest
in any modules, such asTrinoQueryProperties
, routing rules, and gateway itself, because HttpServletRequest input stream(HttpServletRequest.getInputStream()) is consumed already by Jakarta web service framework.