Skip to content

Commit 74539d6

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 a4062d0 commit 74539d6

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

+1-5
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/bookstore/page-6/advanced-event-filtering.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ Append the following Trigger configuration to the existing `node-server/config/2
3636
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
3737
badwordfilter: good # This is the filter that will be applied to the event, only events with the ce-extension badwordfilter: good will be processed
3838
subscriber:
39-
ref:
40-
apiVersion: v1
41-
kind: Service
42-
name: node-server-svc
43-
uri: /insert # This is the path where the event will be sent to the subscriber, see /insert in node-server code: index.js
39+
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
4440
```
4541

4642
```shell

0 commit comments

Comments
 (0)