diff --git a/docs/cloud/demos/ws-gateway.mdx b/docs/cloud/demos/ws-gateway.mdx index e688ddb5..60408580 100644 --- a/docs/cloud/demos/ws-gateway.mdx +++ b/docs/cloud/demos/ws-gateway.mdx @@ -4,21 +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 -2. Create and access key - ```shell +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 copy="fl" +$ fluvio consume webdemo +``` + +[Quick Start]: cloud/quickstart.mdx 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 ```