slinkydeveloper commented on a change in pull request #110: URL: https://github.com/apache/flink-statefun/pull/110#discussion_r425627122
########## File path: statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java ########## @@ -41,12 +45,32 @@ public RequestReplyFunction functionOfType(FunctionType type) { if (spec == null) { throw new IllegalArgumentException("Unsupported type " + type); } - // specific client reuses the same the connection pool and thread pool - // as the sharedClient. - OkHttpClient specificClient = - sharedClient.newBuilder().callTimeout(spec.maxRequestDuration()).build(); - RequestReplyClient httpClient = - new HttpRequestReplyClient(HttpUrl.get(spec.endpoint()), specificClient); - return new RequestReplyFunction(spec.states(), spec.maxNumBatchRequests(), httpClient); + return new RequestReplyFunction( + spec.states(), spec.maxNumBatchRequests(), buildHttpClient(spec)); + } + + private RequestReplyClient buildHttpClient(HttpFunctionSpec spec) { + // We need to build a UDS HTTP client + if (spec.unixDomainSocket() != null) { + OkHttpClient specificClient = + sharedClient + .newBuilder() + .socketFactory(new AFUNIXSocketFactory.FactoryArg(spec.unixDomainSocket())) Review comment: Ok so this factory comes from `common` module, that is the least module we can use because it's the one that contains the `java.net.Socket` implementation ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org