-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
the ekuiper version is 1.13.4 |
Beta Was this translation helpful? Give feedback.
-
Hi @Maingol For the weocket sink, eKuiper will create the websocket connection as client side or server side. For the client side, the rule is defined like following: The eKuiper will try to connect the target endpoint to create the websocket connection {
"id": "redis",
"sql": "SELECT * from demo_stream where temperature > 50",
"actions": [
{
"log": {},
"websocket":{
"addr": "127.0.0.1:8080",
"password": "/api/data"
}
}
]
} For the server side, the rule is defined like following: The other websocket client need to create the connection at the eKuiperHost:10081/api/data endpoint. {
"id": "redis",
"sql": "SELECT * from demo_stream where temperature > 50",
"actions": [
{
"log": {},
"websocket":{
"password": "/api/data"
}
}
]
} |
Beta Was this translation helpful? Give feedback.
-
@Yisaer "action": [ |
Beta Was this translation helpful? Give feedback.
@Yisaer
Then I removed the log node and checked the rule's action again, and it worked correctly. The final request parameters were similar to this:
"action": [
{
"websocket": {"path": "eva", "format": "json"}
}
]
Because this method uses SQL statement-type rules, I had to set up an in-memory output in my flow diagram. In the end, it worked, but this method required me to build additional SQL rules and an in-memory output component. I kept trying to directly pass data to the WebSocket component in the flow diagram. I used a workaround: first, I filled in both the WebSocket server address and path, then I used the API to get the details of this flow rule. After that, I removed the WebSocke…