From d7a31e09cffd8a378e6821cd9673d5888c6842c2 Mon Sep 17 00:00:00 2001 From: Ricardo Niepel Date: Wed, 20 Nov 2019 01:26:19 +0100 Subject: [PATCH] add OPTIONS for bindings (#255) --- concepts/bindings/README.md | 2 ++ reference/api/bindings.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/concepts/bindings/README.md b/concepts/bindings/README.md index d3b0bcfcf..edc5181d0 100644 --- a/concepts/bindings/README.md +++ b/concepts/bindings/README.md @@ -45,6 +45,8 @@ In order to receive events from an input binding: 1. Define the component YAML that describes the type of binding and its metadata (connection info, etc.) 2. Listen on an HTTP endpoint for the incoming event, or use the gRPC proto library to get incoming events +> On startup Dapr sends a ```OPTIONS``` request for all defined input bindings to the application and expects a different status code as ```NOT FOUND (404)``` if this application wants to subscribe to the binding. + Read the [How To](../../howto) section to get started with input bindings. ## Output Bindings diff --git a/reference/api/bindings.md b/reference/api/bindings.md index 0e326e294..eb82eee40 100644 --- a/reference/api/bindings.md +++ b/reference/api/bindings.md @@ -21,7 +21,9 @@ spec: The ```metadata.name``` is the name of the binding. A developer who wants to trigger her app using an input binding can listen on a ```POST``` http endpoint with the route name being the same as ```metadata.name```. -the ```metadata``` section is an open key/value metadata pair that allows a binding to define connection properties, as well as custom properties unique to the implementation. +On startup Dapr sends a ```OPTIONS``` request to the ```metadata.name``` endpoint and expects a different status code as ```NOT FOUND (404)``` if this application wants to subscribe to the binding. + +The ```metadata``` section is an open key/value metadata pair that allows a binding to define connection properties, as well as custom properties unique to the implementation. For example, here's how a Python application subscribes for events from ```Kafka``` using an Dapr API compliant platform: