Skip to content

Commit

Permalink
Adding initial doc for func subscribe
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
matzew committed Nov 9, 2023
1 parent adf7258 commit 3e1a23b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/functions/subscribing-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Subscribe functions to CloudEvents

### Prerequisites

- Knative Eventing installed on the cluster

### Procedure

--8<-- "proc-subscribe-function.md"
24 changes: 24 additions & 0 deletions docs/snippets/proc-subscribe-function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Snippet used in the following topics:
- /docs/functions/subscribing-functions.md
-->
The `subscribe` command will connect the function to a set of events, matching a series of filters for Cloud Event metadata
and a Knative Broker as the source of events, from where they are consumed.

=== "func"

To subscribe the function to events for a given broker, run the following command:

```bash
func subscribe subscribe --filter type=com.example --filter extension=my-extension-value --source my-broker
```

=== "kn func"

To subscribe the function to events for the default broker, run the following command:

```bash
func subscribe subscribe --filter type=com.example --filter extension=my-extension-value
```

!!! note
When invoking `func deploy` the CLI will create Knative Triggers for the function.

0 comments on commit 3e1a23b

Please sign in to comment.