tzulitai opened a new pull request #182:
URL: https://github.com/apache/flink-statefun/pull/182


   This PR adds a module YAML format version, 3.0, which supports function 
endpoint templating.
   
   With 3.0, users define function endpoints like so:
   ```
   endpoints:
      
     ## An endpoint url template for all function types under namespace 
"com.foo.bar"
     - endpoint:
         meta:
             kind: http
         spec:
             typename:
                 namespace: com.foo.bar
             urlPathTemplate: http://bar.foo.com/{typename.function}
             maxNumBatchRequests: 1000
             timeouts:
                 call: 5mins
                 read: 10seconds
   
     ## An endpoint url specifically for the function type "(com.foo.bar, 
hello-world)"
     - endpoint:
         meta:
            kind: http
         spec:
            typename:
              namespace: com.foo.bar
              function: hello-world
            urlPathTemplate: http://bar.foo.com/some/specific/path
   ```
   
   Endpoint URL templates that have been defined for specific types (fully 
specifying both namespace and function name) will have precedence other ones 
that have been widely defined for a namespace.
   
   ## Implementation notes
   
   The main changes required to enable function templating (besides 
implementing the JSON parser for the new format) was the following:
   
   - fd361ca In the Java SDK, allow binding `StatefulFunctionProvider` per 
namespace. Providers bound for specific function types have higher precedence.
   
   - 42cdb52 Logic of resolving the `StatefulFunctionProvider` to use has been 
updated in the `PredefinedFunctionLoader`.
   
   - 326b56a to 6c2ae2f covers the main work around introducing the new YAML 
format. Function endpoint specifications are represented by 
`FunctionEndpointSpec`, with an HTTP implementation `HttpFunctionEndpointSpec`. 
A new type of function provider `TemplatedHttpFunctionProvider` is used for 
instantiating `RequestReplyFunction`s based on the parsed 
`HttpFunctionEndpointSpec`.
   
   - 45f9efb to 1d83341 updates all examples and E2E tests to use module YAML 
format version 3.0.
   
   ## Testing this change
   
   The E2E `ExactlyOnceWithRemoteFnE2E` has been updated to use function 
endpoint templating, so a CI pass would verify the feature end-to-end.


----------------------------------------------------------------
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]


Reply via email to