openfaas / connector-sdk

SDK for connecting events to functions
MIT License
54 stars 25 forks source link

Add configurable async route #23

Closed martindekov closed 5 years ago

martindekov commented 5 years ago

Adding AsyncFunctionInvocation variable in the ControllerConfig in order to enable/disable asynchronous invokation of functions along with augmenting on how we build the gateway URL

Vendored change can be tested in kafka-connector by augmenting the image with mine: martindekov/kafka-connector:0.3.5 and adding environmental variable asynchronous_invocation to true/false or 1/0 for true in the connector-dep.yml file

Closes #1

Tested by vendoring the change in the kafka-connector and invoking function through the asynchronous path, the output in the kafka-connector looks like this:

2019/06/10 13:24:11 Syncing topic map
[#1] Received on [faas-request,0]: 'asdf'
2019/06/10 13:24:12 Invoke function: figlet
2019/06/10 13:24:12 connector-sdk got result: [202] faas-request => figlet (0) bytes
[202] faas-request => figlet

Signed-off-by: Martin Dekov mdekov@vmware.com

alexellis commented 5 years ago

@martindekov what's the helm install/upgrade step that someone can type in such as myself or @zeerorg?

alexellis commented 5 years ago

For vendoring into kafka-connector, etc: https://github.com/openfaas-incubator/connector-sdk/releases/tag/0.4.1

martindekov commented 5 years ago

I will vendor it as soon as I can

martindekov commented 5 years ago

Also will add it to the helm chart in the faas-netes repo