Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,50 @@ Follow the instructions below to create the API using the basic flow.

### Step 2 - Configure the Topics

Topics of an SSE API are always **Subscribe only**, where the flow of events will be from the server (backend) to the client. By default, an SSE API will have a topic with the name `/*`.
Topics of a SSE API are always **Receive only**, where the flow of events will be from the server (backend) to the client.

1. Click **Topics** under **API Configurations** to navigate to the **Topics** page.

2. Modify the topics as follows and click **Save** to update them.
2. By default, the newly created SSE API will have a topic with the name `/*`.

1. Optionally, click delete, as shown below, to delete an existing topic.
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-topics.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-topics.png" width="80%" alt="SSE API Topics Page"></a>

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-delete-default-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-delete-default-topic.png" width="80%" alt="SSE API Delete Existing Topic"></a>
3. This default channel `/*` will have a default operation `receive_/*`.

2. Select **sub** under **Types**, enter the **Topic Name**, and click **+** as shown below, to add a new topic.
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-operation.png" width="80%" alt="SSE API Channel Operations"></a>

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-create-new-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-create-new-topic.png" width="80%" alt="SSE API Add Topic"></a>
4. Modify the topics as follows and click **Save** to update them.

The newly added topic is displayed as follows.
1. Optionally, click delete as shown below, to delete an existing topic or an operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-newly-added-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-newly-added-topic.png" width="80%" alt="SSE API Newly Added Topic"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-delete-default-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-delete-default-topic.png" width="80%" alt="SSE API Delete Existing Topic"></a>

2. Select **receive** under **Types**, enter the **Address** of the channel to be created, enter the **Operation Name** to be added to the selected channel, and click **+** as shown below, to add a new topic.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-create-new-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-create-new-topic.png" width="80%" alt="SSE API Add Topic"></a>

The newly added topic is displayed as follows. Expand the topic to view the newly added operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-newly-added-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-newly-added-topic.png" width="80%" alt="SSE API Newly Added Topic"></a>

3. You can also add a new operation to an existing topic by selecting the respective channel address from the dropdown.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-add-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-add-operation.png" width="80%" alt="SSE API Add Operation"></a>

Expand the topic to view the newly added operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-new-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-new-operation.png" width="80%" alt="SSE API Newly Added Operation"></a>

### Step 3 - View the AsyncAPI Definition

Click **AsyncAPI Definition** under **API Configurations**.

!!! note
The API definition will be generated in AsyncAPI V3.0.0.

The AsyncAPI definition of the streaming API, which you just created, appears.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-asyncapi.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-asyncapi.png" width="80%" alt="SSE API AsyncAPI Definition"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-asyncapi.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/sse-api-v3-asyncapi.png" width="80%" alt="SSE API AsyncAPI Definition"></a>

### Step 4 - Configure the Runtime Configurations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ Follow the instructions below to create a Streaming API using an AsyncAPI defini
* **AsyncAPI URL** - If you select this option, you need to provide a URL.
* **AsyncAPI File** - If you select this option, click **Browse File to Upload** and upload a file, which contains an AsyncAPI definition.

3. Select the way in which you are going to import the AsynAPI definition, and click **Next**.

For this example, let's select **AsyncAPI URL**, provide the following URL, and click **Next**.
3. Select the way in which you are going to import the AsyncAPI definition, and click **Next**.

```sh
https://raw.githubusercontent.com/asyncapi/spec/v2.0.0/examples/2.0.0/streetlights.yml
```
<html><div class="admonition note">
<p class="admonition-title">Note</p>
<p>AsyncAPI import now supports both AsyncAPI v2.x and AsyncAPI v3.0 definitions.</p>
</div>
</html>

For this example, let's select **AsyncAPI File**, upload the following file, and click **Next**.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-from-asyncapi-url-import.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-from-asyncapi-url-import.png" width="80%" alt ="Import Websocket Streaming API from AsyncAPI URL"></a>
[Download AsyncAPI V3 file]({{base_path}}/assets/attachments/103332601/streetlights_v3-def.yml)

<a href="{{base_path}}/assets/attachments/103332601/asyncv3-file.png"><img src="{{base_path}}/assets/attachments/103332601/asyncv3-file.png" width="80%" alt="Import Websocket Streaming API from AsyncAPI File"></a>

4. Edit the Streaming API information and click **Create**.

Expand Down Expand Up @@ -67,19 +71,25 @@ Follow the instructions below to create a Streaming API using an AsyncAPI defini

Click **Topics** to navigate to the topics page.

[![AsyncAPI topics]({{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-from-asyncapi-topics.png)]({{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-from-asyncapi-topics.png)
[![AsyncAPI topics]({{base_path}}/assets/img/design/create-api/streaming-api/asyncv3-topics.png)]({{base_path}}/assets/img/design/create-api/streaming-api/asyncv3-topics.png)

You will notice that the topics have been created automatically from the AsyncAPI definition specified in the provided URL.

[![AsyncAPI operations]({{base_path}}/assets/img/design/create-api/streaming-api/asyncv3-operations.png)]({{base_path}}/assets/img/design/create-api/streaming-api/asyncv3-operations.png)

Expand each topic to view the operations which are automatically created for each channel, as defined in the specification.
Comment on lines +74 to +80
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix source wording mismatch in Topics step.

Line 76 still says topics are created from the “provided URL”, but this walkthrough now uses file upload (Lines 40-42). Please make the sentence source-agnostic (e.g., “provided AsyncAPI definition”).

✏️ Proposed text fix
-You will notice that the topics have been created automatically from the AsyncAPI definition specified in the provided URL.
+You will notice that the topics have been created automatically from the provided AsyncAPI definition.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@en/docs/api-design-manage/design/create-api/create-streaming-api/create-a-streaming-api-from-an-asyncapi-definition.md`
around lines 74 - 80, Update the wording in the Topics step by replacing the
phrase "provided URL" with a source-agnostic term such as "provided AsyncAPI
definition" (or "provided definition") so the sentence no longer assumes upload
method; find the paragraph containing "topics have been created automatically
from the AsyncAPI definition specified in the provided URL" and change it to use
the new phrase so it matches both file upload and URL inputs.


## Step 3 - View the AsyncAPI Definition

Click **AsyncAPI Definition** under **API Configurations**.

The AsyncAPI definition of the streaming API, which you just created, appears.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-view-asyncapi.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-view-asyncapi.png" alt="WebSocket API AsyncAPI Definition"></a>
<a href="{{base_path}}/assets/attachments/103332601/asyncv3-def-view.png"><img src="{{base_path}}/assets/attachments/103332601/asyncv3-def-view.png" alt="WebSocket API AsyncAPI Definition"></a>

Now, you have successfully created a Streaming API from an Async API Definition.

Now, you have successfully created a Streaming API from an Async API Definition.
If you have created the streaming API using an AsyncAPI v2.x definition, see [AsyncAPI v2.x for APIM 4.6.0](https://apim.docs.wso2.com/en/latest/api-design-manage/design/create-api/create-streaming-api/create-a-streaming-api-from-an-asyncapi-definition/).

Next, publish the API, for more information, see [Publish an API]({{base_path}}/deploy-and-publish/publish-on-dev-portal/publish-an-api).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,44 +129,66 @@ Follow the instructions below to create a WebSocket API using the basic flow:

### Step 2 - Configure the Topics

Topics of a WebSocket API are always **Subscribe (sub) and Publish (pub)**, where the flow of events can be either from the server (backend) to the clients or from the client to the server. By default, the WebSocket API will have a topic with the name `/*`.
Topics of a WebSocket API represents the channels which support actions **Receive and Send**, where the flow of events can be either from the server (backend) to the clients or from the client to the server.

1. Click **Topics** under **API Configurations** and navigate to the **Topics** page.

2. By default, the newly created WebSocket API will have a topic with the name `/*`.

2. Modify the topics as follows and click **Save** to update them.
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-topics.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-topics.png" width="80%" alt="WebSocket API Topics Page"></a>

1. Optionally, click delete as shown below, to delete an existing topic.
3. This default channel `/*` will have two default operations `send_/*` and `receive_/*` and are listed inside the respective action of the channel.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-delete-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-delete-topic.png" width="80%" alt="WebSocket API Delete Topic"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-operation.png" width="80%" alt="WebSocket API Channel Operations"></a>

2. Select the **Types**, enter the **Topic Name**, and click **+** as shown below, to add a new topic.
4. Modify the topics as follows and click **Save** to update them.

<table><tr><td>Topic Name</td><td><code>/notifications</code></td> </tr></table>
1. Optionally, click delete as shown below, to delete an existing topic or an operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-add-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-add-topic.png" width="80%" alt="WebSocket API Add Topic"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-delete-topic-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-delete-topic-operation.png" width="80%" alt="WebSocket API Delete Topic"></a>

The newly added topic is displayed as follows.
2. Select a **Type**, enter the **Address** of the channel to be created, enter the **Operation Name** to be added to the selected channel, and click **+** as shown below, to add a new topic.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-newly-added-topic.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-newly-added-topic.png" width="80%" alt="WebSocket API Newly Added Topic"></a>
<table>
<tr><td>Channel Address</td><td><code>/notifications</code></td> </tr>
<tr><td>Operation Name</td><td><code>sendNotifications</code></td> </tr>
</table>

3. Optionally, provide a URL Mapping to the topic.
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-channel.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-channel.png" width="80%" alt="WebSocket API Add Channel"></a>

The newly added topic is displayed as follows. Expand the topic to view the newly added operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-new-channel.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-new-channel.png" width="80%" alt="WebSocket API Newly Added Topic"></a>

3. You can also add a new operation to an existing topic by selecting the respective channel address from the dropdown.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-operation.png" width="80%" alt="WebSocket API Add Operation"></a>

Expand the topic to view the newly added operation.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-new-operation.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-new-operation.png" width="80%" alt="WebSocket API Newly Added Operation"></a>

4. Optionally, provide a URL Mapping to the topic.

The provided URL Mapping will be appended to the WebSocket endpoint URL that you provided when creating the API, and the traffic via this topic will be sent to the resulting URL.

Expand **both** PUB and SUB under the created topic, provide the same URL Mapping for both and click **Save**.
Expand **both** SEND and RECEIVE under the created topic, provide the same URL Mapping for both and click **Save**.

<table><tr><td> Description</td> <td>Chat room notifications</td> </tr>
<tr><td>URL Mapping</td> <td><code>/notifications</code></td> </tr></table>

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix probable broken screenshot path.

Line 180 uses wesocket-streaming-api-v3-add-topic-url-mapping.png; websocket is misspelled, so this link is likely broken.

🖼️ Proposed path fix
-<a href="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
+<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-topic-url-mapping.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-add-topic-url-mapping.png" width="80%" alt="WebSocket API Topic URL Mapping"></a>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@en/docs/api-design-manage/design/create-api/create-streaming-api/create-a-websocket-streaming-api.md`
at line 180, The image filename in the Markdown uses a typo
("wesocket-streaming-api-v3-add-topic-url-mapping.png") which likely breaks the
screenshot link; update the src and href occurrences to the correct filename
"websocket-streaming-api-v3-add-topic-url-mapping.png" in the line containing
the <a
href="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png">
and the <img
src="{{base_path}}/assets/img/design/create-api/streaming-api/wesocket-streaming-api-v3-add-topic-url-mapping.png">
references so both link and image point to the corrected file name.


### Step 3 - View the AsyncAPI Definition

Click **AsyncAPI Definition** under **API Configurations**.

!!! note
The API definition will be generated in AsyncAPI V3.0.0.

The AsyncAPI definition of the streaming API, which you just created, appears.

<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-asyncapi.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-asyncapi.png" width="65%" alt="WebSocket API AsyncAPI Definition"></a>
<a href="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-asyncapi.png"><img src="{{base_path}}/assets/img/design/create-api/streaming-api/websocket-streaming-api-v3-asyncapi.png" width="65%" alt="WebSocket API AsyncAPI Definition"></a>

### Step 4 - Configure the Runtime Configurations

Expand Down
Loading