Skip to content

Commit 583f434

Browse files
committed
fix: set up the trigger that will filter out the bad comment and send them to the event display
1 parent 4dd9921 commit 583f434

File tree

1 file changed

+4
-20
lines changed
  • code-samples/eventing/bookstore-sample-app/db/bookstore-eda

1 file changed

+4
-20
lines changed
Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
1-
apiVersion: eventing.knative.dev/v1
2-
kind: Trigger
3-
metadata:
4-
name: event-display-trigger
5-
spec:
6-
broker: broker
7-
filter:
8-
attributes:
9-
type: sentiment-analysis-request
10-
subscriber:
11-
ref:
12-
apiVersion: serving.knative.dev/v1
13-
kind: Service
14-
name: sentiment-analysis-app
15-
16-
17-
---
18-
1+
# This Trigger subscribes to the Broker and filters events based on the type and badwordfilter attribute.
2+
# Those comments that contain insults are filtered out by the badwordfilter attribute and they will be redirected to the event-display Service.
193
apiVersion: eventing.knative.dev/v1
204
kind: Trigger
215
metadata:
@@ -24,11 +8,11 @@ spec:
248
broker: broker
259
filter:
2610
attributes:
27-
type: knative.sampleapp.sentiment.response
11+
type: moderated-comment
12+
badwordfilter: bad
2813
subscriber:
2914
ref:
3015
apiVersion: serving.knative.dev/v1
3116
kind: Service
3217
name: event-display
3318

34-

0 commit comments

Comments
 (0)