-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSON message validation stream processor example
- Loading branch information
1 parent
2878cae
commit b2619eb
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
deployments/tyk/scripts/examples/streams/validated-pubsub/validated-pubsub-1.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
echo "Streams - Validated PubSub" | ||
echo "Part 1: Listening for validated server-sent events" | ||
echo "This script connects to a server-sent event endpoint, and waits to receive messages." | ||
echo "Use script 3 to send messages." | ||
|
||
curl http://tyk-gateway.localhost:8080/streams-simple-pubsub/validated-sse |
6 changes: 6 additions & 0 deletions
6
deployments/tyk/scripts/examples/streams/validated-pubsub/validated-pubsub-2.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
echo "Streams - Validated PubSub" | ||
echo "Part 2: Publishing a valid message" | ||
echo "This script publishes a valid message to the clients connected in script 1." | ||
echo "Check the first terminal to see the messages received." | ||
|
||
curl http://tyk-gateway.localhost:8080/streams-simple-pubsub/validated-pub -d '{ "name": "Tyk Streams", "age": 21 }' |
6 changes: 6 additions & 0 deletions
6
deployments/tyk/scripts/examples/streams/validated-pubsub/validated-pubsub-3.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
echo "Streams - Validated PubSub" | ||
echo "Part 3: Publishing an invalid message" | ||
echo "This script publishes an invalid message, which the gateway prevents subscribers from receiving." | ||
echo "Check the first terminal to see that the message is not received, and the fourth terminal to see the logged error." | ||
|
||
curl http://tyk-gateway.localhost:8080/streams-simple-pubsub/validated-pub -d '{ "name": "Tyk", "age": 3 }' |
6 changes: 6 additions & 0 deletions
6
deployments/tyk/scripts/examples/streams/validated-pubsub/validated-pubsub-4.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
echo "Streams - Validated PubSub" | ||
echo "Part 4: Displaying errors from the application log" | ||
echo "This script watches the Tyk Gateway application log for 'Schema validation failed' messages.". | ||
echo "It will display the error message generated by the invalid request sent by script 3." | ||
|
||
docker logs -f tyk-demo-tyk-gateway-1 2>&1 | grep -E "@service=benthos.*path=root.pipeline.processors.1.catch.0" |