From c8c9c0e681b0e76b2677bd6adedc66d1629ff88a Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 6 Feb 2025 06:30:49 -0500 Subject: [PATCH 1/4] make web demo cmds copy --- docs/cloud/demos/ws-gateway.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/cloud/demos/ws-gateway.mdx b/docs/cloud/demos/ws-gateway.mdx index e688ddb5..7c1afcca 100644 --- a/docs/cloud/demos/ws-gateway.mdx +++ b/docs/cloud/demos/ws-gateway.mdx @@ -10,8 +10,11 @@ sidebar_position: 1 3. Login with CLI 4. Create a Cluster 5. Create a topic named webdemo -2. Create and access key - ```shell + ```shell copy="fl" + $ fluvio topic create webdemo + ``` +2. Create an access key + ```shell copy="fl" $ fluvio cloud access-key create web-demo --topic webdemo ``` 4. Start producer with access key From f13a0f6b62eb1293307449d0842f5159f343caa4 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 6 Feb 2025 11:22:34 -0500 Subject: [PATCH 2/4] fl --- docs/cloud/how-to/use-ws-gateway.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/cloud/how-to/use-ws-gateway.mdx b/docs/cloud/how-to/use-ws-gateway.mdx index 06d310c4..f069ae52 100644 --- a/docs/cloud/how-to/use-ws-gateway.mdx +++ b/docs/cloud/how-to/use-ws-gateway.mdx @@ -12,7 +12,7 @@ The WebSocket Gateway allows you to produce and consume data using a WebSocket c First, create a topic to interact with. -```shell +```shell copy="fl" $ fluvio topic create my-topic topic "my-topic" created ``` @@ -21,7 +21,7 @@ topic "my-topic" created Create an access key to authenticate the WebSocket connection. This key will only allow access to the specified topic. -```shell +```shell copy="fl" $ fluvio cloud access-key create my-access-key-1 --topic my-topic Access key "my-access-key-1" created: zGO0WBmCM4EAEJYbksCjGzJrrKHdgwPa - Produce: wss://infinyon.cloud/wsr/v1/simple/produce?access_key=zGO0WBmCM4EAEJYbksCjGzJrrKHdgwPa @@ -32,12 +32,12 @@ Access key "my-access-key-1" created: zGO0WBmCM4EAEJYbksCjGzJrrKHdgwPa Optionally, you can restrict an access key to only allow producing or consuming data by passing the `--consume` or `--produce` flag when creating the access key. #### Consume Only -```shell +```shell copy="fl" $ fluvio cloud access-key create my-consume-key --topic my-topic --consume ``` #### Produce Only -```shell +```shell copy="fl" $ fluvio cloud access-key create my-produce-key --topic my-topic --produce ``` From 7c56712db6d4565b56b2633e92a67cfe4b30f1c3 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 6 Feb 2025 13:06:26 -0500 Subject: [PATCH 3/4] revise steps --- docs/cloud/demos/ws-gateway.mdx | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/docs/cloud/demos/ws-gateway.mdx b/docs/cloud/demos/ws-gateway.mdx index 7c1afcca..3a82073c 100644 --- a/docs/cloud/demos/ws-gateway.mdx +++ b/docs/cloud/demos/ws-gateway.mdx @@ -4,24 +4,31 @@ description: "WebSocket Gateway Demomstration" sidebar_position: 1 --- -1. Setup a Cloud Cluster - 1. Register - 2. Install CLI - 3. Login with CLI - 4. Create a Cluster - 5. Create a topic named webdemo - ```shell copy="fl" - $ fluvio topic create webdemo - ``` -2. Create an access key +1. Setup an Infinyon Cloud cluster by following the [Quick Start] +2. Create a topic named webdemo + ```shell copy="fl" + $ fluvio topic create webdemo + ``` +3. Create an access key ```shell copy="fl" $ fluvio cloud access-key create web-demo --topic webdemo ``` -4. Start producer with access key -3. Start consumer with access key +4. Start producer with access key from step 3 +5. Start consumer with access key from step 3 ### Producer Iframe +The producer demo app runs in a CodePen iframe. It will connect to the WebSocket Gateway and produce (x, y) values of a sine wave to the webdemo topic. This is independent of the consumer charting app and is only interacting with the Fluvio topic via the WebSocket Gateway. ### Consumer Iframe +The consumer demo app runs in a CodePen iframe. It will connect to the WebSocket Gateway and consume and chart (x, y) values from the webdemo topic. This is independent of the sine wave producer app and is only interacting with the Fluvio topic via the WebSocket Gateway. + +### Watch with Fluvio CLI +The data being produced can be simultaneously consumed with the Fluvio CLI. + +```shell +$ fluvio consume webdemo +``` + +[Quick Start]: cloud/quickstart.mdx From 20e77e45454a84639ce941e354ae0fd3e8b0e6ec Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Thu, 6 Feb 2025 15:48:52 -0500 Subject: [PATCH 4/4] copy --- docs/cloud/demos/ws-gateway.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cloud/demos/ws-gateway.mdx b/docs/cloud/demos/ws-gateway.mdx index 3a82073c..60408580 100644 --- a/docs/cloud/demos/ws-gateway.mdx +++ b/docs/cloud/demos/ws-gateway.mdx @@ -27,7 +27,7 @@ The consumer demo app runs in a CodePen iframe. It will connect to the WebSocket ### Watch with Fluvio CLI The data being produced can be simultaneously consumed with the Fluvio CLI. -```shell +```shell copy="fl" $ fluvio consume webdemo ```