Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • statefun-3.1.0
    • Stateful Functions
    • None

    Description

      Currently, we ship and always use by default a RequestReplyClient implementation based on OkHttp. We'd like to allow users to use their own implementations of the RequestReplyClient for remote invocations. This is strictly for extending the means of transport, and should not leave room to touch the invocation protocol.

      The way this would look like in the module YAML files for remote modules would be:

      module:
          spec:
              endpoints:
                  - endpoint:
                         meta:
                             kind: http
                         spec:
                             functions: com.foo.bar/*
                             urlPathTemplate: http://bar.foo.com:8080/functions/{function.name}
                             transport:
                                 extension: com.foo.bar/some.custom.client
                                 prop1: foobar
                                 prop2:
                                     - k: v
                                     - k2: v2
                                 ....
      

      The important part is the transport section. If not specified, then the default OkHttp implementation will be used. Otherwise, if specified, an extension with the specified typename must be bound and exist in the application, and that extension needs to be a RequestReplyClientFactory:

      interface RequestReplyClientFactory {
          RequestReplyClient create(JSONNode properties, URI endpointUrl);
      }
      

      The provided JSON node properties will be as is provided in the transport block of the module YAML endpoint specification.

      Attachments

        Activity

          People

            tzulitai Tzu-Li (Gordon) Tai
            tzulitai Tzu-Li (Gordon) Tai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: