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
| pipeline { | |
| agent any | |
| tools { | |
| maven "mvn" | |
| } | |
| environment { | |
| DOCKER_REGISTRY = 'JFROG_ARTIFACTORY_URL' | |
| ARTIFACTORY_USERNAME= 'JFROG_ARTIFACTORY_USERNAME' |
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
| import ballerina/http; | |
| import ballerina/log; | |
| import ballerina/io; | |
| // Annotations specifying the webSocket service. | |
| @http:WebSocketServiceConfig { | |
| path: "/websocket" | |
| } | |
| // Define the backend service with port 15300. |
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
| import ballerina/io; | |
| import ballerina/http; | |
| public function main() { | |
| http:WebSocketClient wsClientEp = new("ws://localhost:9090/websocket", config = {callbackService: ClientService}); | |
| checkpanic wsClientEp->pushText("hello"); | |
| } | |
| service ClientService =@http:WebSocketServiceConfig {} service { | |
| resource function onText(http:WebSocketClient conn, string text, boolean finalFrame) { |
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
| import ballerina/http; | |
| import ballerina/log; | |
| @http:WebSocketServiceConfig { | |
| path: "/hello/ws" | |
| } | |
| service basic on new http:Listener(21005) { | |
| // The resource is triggered after a successful client connection | |
| resource function onOpen(http:WebSocketCaller caller) { | |
| log:printInfo("connection open"); |
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
| import ballerina/http; | |
| import ballerina/io; | |
| public function main() { | |
| http:WebSocketClient wsClientEp = new("ws://echo.websocket.org", | |
| config = {callbackService: ClientService}); | |
| checkpanic wsClientEp->pushText("hello"); | |
| } | |
| service ClientService =@http:WebSocketServiceConfig {} service { |