Skip to content

Commit 865ca51

Browse files
committed
sample-app: Use hardcoded URL as db-insert trigger subscriber
This is needed because the node-server service listens on port 8080, and the K8s ref resolver doesn't support custom ports [1], and referring to the node-server-svc service yields: http://node-server-svc.default.svc.cluster.local/insert Instead of the correct URL: http://node-server-svc.default.svc.cluster.local:8080/insert Which results in hanging connections and eventually timeouts when adding new comments that pass the trigger's filter. [1] https://github.com/knative/pkg/blob/dcf159339de2fec9dde678a04cb7a354e912d2bf/resolver/addressable_resolver.go#L227 Signed-off-by: Guzman <[email protected]>
1 parent 2dca181 commit 865ca51

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

code-samples/eventing/bookstore-sample-app/solution/node-server/config/200-broker.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,4 @@ spec:
1515
type: moderated-comment # This is the filter that will be applied to the event, only events with the ce-type moderated-comment will be processed
1616
badwordfilter: good # This is the filter that will be applied to the event, only events with the ce-extension badwordfilter: good will be processed
1717
subscriber:
18-
ref:
19-
apiVersion: v1
20-
kind: Service
21-
name: node-server-svc
22-
uri: /insert # This is the path where the event will be sent to the subscriber, see /insert in node-server code: index.js
18+
uri: http://node-server-svc.default.svc.cluster.local:8080/insert # This is the path where the event will be sent to the subscriber, see /insert in node-server code: index.js

docs/versioned/bookstore/page-6/advanced-event-filtering.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ Append the following Trigger configuration to the existing `node-server/config/2
4343
type: moderated-comment # This is the filter that will be applied to the event, only events with the ce-type moderated-comment will be processed
4444
badwordfilter: good # This is the filter that will be applied to the event, only events with the ce-extension badwordfilter: good will be processed
4545
subscriber:
46-
ref:
47-
apiVersion: v1
48-
kind: Service
49-
name: node-server-svc
50-
uri: /insert # This is the path where the event will be sent to the subscriber, see /insert in node-server code: index.js
46+
uri: http://node-server-svc.default.svc.cluster.local:8080/insert # This is the path where the event will be sent to the subscriber, see /insert in node-server code: index.js
5147
```
5248

5349
```shell

0 commit comments

Comments
 (0)