slinkydeveloper commented on a change in pull request #110:
URL: https://github.com/apache/flink-statefun/pull/110#discussion_r426784122
##########
File path:
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java
##########
@@ -41,12 +48,56 @@ public RequestReplyFunction functionOfType(FunctionType
type) {
if (spec == null) {
throw new IllegalArgumentException("Unsupported type " + type);
}
+ return new RequestReplyFunction(
+ spec.states(), spec.maxNumBatchRequests(), buildHttpClient(spec));
+ }
+
+ private RequestReplyClient buildHttpClient(HttpFunctionSpec spec) {
+ // We need to build a UDS HTTP client
+ if (spec.isUnixDomainSocket()) {
+
+ // We need to split the path in order to get the sock file and the path
after the sock file
+ Map.Entry<String, String> splittedFilePathAndEndpoint =
+ splitFilePathAndEndpointForUDS(spec.endpoint());
+
+ OkHttpClient specificClient =
+ sharedClient
+ .newBuilder()
+ .socketFactory(
+ new
AFUNIXSocketFactory.FactoryArg(splittedFilePathAndEndpoint.getKey()))
Review comment:
Looking at the activity on the two projects, to me it looks a little bit
more mantained/mature junixsocket.
Let's see if the solution with junixsocket is trivial, otherwise I'll switch
to jnrsockets.
----------------------------------------------------------------
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:
[email protected]