-
Notifications
You must be signed in to change notification settings - Fork 17
Source/Sink types - websocket and websocket-server #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jamesm-macrometa
wants to merge
12
commits into
main
Choose a base branch
from
websocket-source-sink
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7cec224
Create websocket.md
jamesm-macrometa 7a96b02
Add empty docs
jamesm-macrometa eb904eb
Update websocket.md
jamesm-macrometa 9de0e1e
Update websocket.md
jamesm-macrometa 3c4f50e
Update websocket.md
jamesm-macrometa 3158c9d
Updates
jamesm-macrometa c564e9c
updates
jamesm-macrometa 3fe8a1b
Update docs/cep/sink/sink-types/websocket-server.md
jamesm-macrometa 83880df
Update docs/cep/sink/sink-types/websocket.md
jamesm-macrometa 498be80
Update docs/cep/sink/sink-types/websocket.md
jamesm-macrometa ffe5bd5
Change xml to json
jamesm-macrometa 2d2afb6
Merge branch 'websocket-source-sink' of https://github.com/Macrometac…
jamesm-macrometa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,35 @@ | ||
| --- | ||
| title: websocket-server | ||
| --- | ||
|
|
||
| The [WebSocket sink](websocket.md) sends events through the server which are then passed to the `example` stream. All events received by `example` stream are then sent to the WebSocket server | ||
|
|
||
| Clients can connect to `ws://localhost:9025/abc` to receive events from the stream. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```sql | ||
| CREATE SINK <NAME> WITH (type="websocket-server", map.type="<STRING>", host="<STRING>", port="<STRING>", sub.protocol="<STRING>", idle.timeout="<INT>", tls.enabled="<BOOL>", keystore.path="<STRING>", keystore.password="<STRING>")) | ||
| ``` | ||
|
|
||
| ## Query Parameters | ||
|
|
||
|
|
||
| | Name | Description | Default Value | Possible Data Types | Optional | Dynamic | | ||
| |------|------------------|---------------|---------------------|----------|---------| | ||
| | host | Host name for the WebSocket server. | - | STRING | No | No | | ||
| | port | Port number for the WebSocket server. | - | STRING | No | No | | ||
| | sub.protocol | Sub-Protocols which are allowed by the service. Use format `subprotocol1, subprotocol2,...` | `null` | STRING | Yes | No | | ||
| | idle.timeout | `-1` | INT | Yes | No | | ||
| | tls.enabled | `false` | BOOL | Yes | No | | ||
| | keystore.path | `${carbon.home}/resources/security/wso2carbon.jks` | STRING | Yes | No | | ||
| | keystore.password | `wso2carbon` | STRING | Yes | No | | ||
|
|
||
|
|
||
| ## Example | ||
|
|
||
| ```sql | ||
| CREATE SINK <NAME> WITH (type = 'websocket-server', map.type='json', host='localhost', port='8025') | ||
|
|
||
| CREATE STREAM example (attribute1 string, attribute2 int); | ||
| ``` | ||
This file contains hidden or 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,34 @@ | ||
| --- | ||
| title: websocket | ||
| --- | ||
|
|
||
| The WebSocket sink sends events to be processed by Macrometa from a topic in a [WebSocket server](websocket-server.md). | ||
|
|
||
| All events delivered to `example` stream are also sent to the WebSocket server. | ||
|
|
||
| Configure the server before using the following procedure. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```sql | ||
| CREATE SINK <NAME> WITH (type="websocket", url="<SERVER URL>", map.type="<STRING>", sub.protocol="<STRING>", headers="<STRING>", idle.timeout="<INT>", truststore.path="<STRING>", truststore.password="<STRING>")) | ||
| ``` | ||
|
|
||
jamesm-macrometa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Query Parameters | ||
|
|
||
| | Name | Description | Default Value | Possible Data Types | Optional | Dynamic | | ||
| |------|------------------|---------------|---------------------|----------|---------| | ||
| | url | The URL of the remote endpoint. Must be `ws` or `wss`. | - | STRING | No | No | | ||
| | sub.protocol | The negotiable sub-protocol if required by server. Use format `subprotocol1, subprotocol2,...` | `null` | STRING | Yes | No | | ||
| | headers | Any specific headers which need to send to the server. Use format `'key1:value1', 'key2:value2',...` | `null` | Yes | No | | ||
| | idle.timeout | Idle timeout of the connection | `-1` | INT | Yes | No | | ||
| | truststore.path | The file path to the location of the truststore. If a custom truststore is not specified, then the system uses the default truststore file - wso2carbon.jks in the `${carbon.home}/resources/security` directory. | `${carbon.home}/resources/security/client-truststore.jks` | STRING | Yes | No | | ||
| | truststore.password | The password for the truststore. A custom password can be specified if required. | `wso2carbon` | STRING | Yes | No | | ||
|
|
||
jamesm-macrometa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Example | ||
|
|
||
| ```sql | ||
| CREATE SINK <NAME> WITH (type='websocket', url ='ws://localhost:8025/websockets/abc', map.type='json') | ||
|
|
||
| CREATE STREAM example (attribute1 string, attribute2 int); | ||
| ``` | ||
This file contains hidden or 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,31 @@ | ||
| --- | ||
| title: websocket-server | ||
| --- | ||
|
|
||
| The [WebSocket source](websocket.md) receives events through the server which are then passed to the `example` stream for processing. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```sql | ||
| CREATE SOURCE <NAME> WITH (type="websocket-server", map.type="<STRING>", host="<STRING>", port="<STRING>", sub.protocol="<STRING>", idle.timeout="<INT>", tls.enabled="<BOOL>", keystore.path="<STRING>", keystore.password="<STRING>")) | ||
| ``` | ||
|
|
||
| ## Query Parameters | ||
|
|
||
| | Name | Description | Default Value | Possible Data Types | Optional | Dynamic | | ||
| |------|------------------|---------------|---------------------|----------|---------| | ||
| | host | Host name for the WebSocket server. | - | STRING | No | No | | ||
| | port | Port number for the WebSocket server. | - | STRING | No | No | | ||
| | sub.protocol | Sub-Protocols which are allowed by the service. Use format `subprotocol1, subprotocol2,...` | `null` | STRING | Yes | No | | ||
| | idle.timeout | `-1` | INT | Yes | No | | ||
| | tls.enabled | `false` | BOOL | Yes | No | | ||
| | keystore.path | `${carbon.home}/resources/security/wso2carbon.jks` | STRING | Yes | No | | ||
| | keystore.password | `wso2carbon` | STRING | Yes | No | | ||
|
|
||
| ## Example | ||
|
|
||
| ```sql | ||
| CREATE SOURCE <NAME> WITH (type='websocket-server', map.type='json', host='localhost', port='8025') | ||
|
|
||
| CREATE STREAM example (attribute1 string, attribute2 int); | ||
| ``` |
This file contains hidden or 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,34 @@ | ||
| --- | ||
| title: websocket | ||
| --- | ||
|
|
||
| The WebSocket source receives events to be processed by Macrometa from a topic in a [WebSocket server](websocket-server.md). | ||
|
|
||
| Configure the server before using the following procedure. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```sql | ||
| CREATE SOURCE <NAME> WITH (type="websocket", url="<SERVER URL>", map.type="<STRING>", sub.protocol="<STRING>", headers="<STRING>", idle.timeout="<INT>", truststore.path="<STRING>", truststore.password="<STRING>")) | ||
| ``` | ||
|
|
||
|
|
||
| ## Query Parameters | ||
|
|
||
| | Name | Description | Default Value | Possible Data Types | Optional | Dynamic | | ||
| |------|------------------|---------------|---------------------|----------|---------| | ||
| | url | The URL of the remote endpoint. Must be `ws` or `wss`. | - | STRING | No | No | | ||
| | sub.protocol | The negotiable sub-protocol if required by server. Use format: `subprotocol1, subprotocol2,...` | null | STRING | Yes | No | | ||
| | headers | Any specific headers which need to send to the server. Use format: `'key1:value1', 'key2:value2',...` | Yes | No | | ||
| | idle.timeout | Idle timeout of the connection | `-1` | INT | Yes | No | | ||
| | truststore.path | The file path to the location of the truststore. If a custom truststore is not specified, then the system uses the default truststore file - wso2carbon.jks in the `${carbon.home}/resources/security` directory. | `${carbon.home}/resources/security/client-truststore.jks` | STRING | Yes | No | | ||
| | truststore.password | The password for the truststore. A custom password can be specified if required. | `wso2carbon` | STRING | Yes | No | | ||
|
|
||
|
|
||
| ## Example | ||
|
|
||
| ```sql | ||
| CREATE SOURCE <NAME> WITH (type='websocket', url ='ws://localhost:8025/websockets/abc', map.type='json') | ||
|
|
||
| CREATE STREAM example (attribute1 string, attribute2 int); | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StoyanTc Does the URL have to be this specific value (
ws://localhost:9025/abc)? Or do we need to provide more specific instructions for connecting?