{"id":24736360,"url":"https://github.com/engineering-research-and-development/true-connector-websocket_message_streamer","last_synced_at":"2026-05-11T02:20:27.912Z","repository":{"id":39859983,"uuid":"266112226","full_name":"Engineering-Research-and-Development/true-connector-websocket_message_streamer","owner":"Engineering-Research-and-Development","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-09T14:02:30.000Z","size":79,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-02T15:06:22.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Engineering-Research-and-Development.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-22T13:03:41.000Z","updated_at":"2024-07-09T14:01:35.000Z","dependencies_parsed_at":"2024-07-09T17:24:09.418Z","dependency_job_id":"763118a6-cb62-41f7-935f-433e1b1445e3","html_url":"https://github.com/Engineering-Research-and-Development/true-connector-websocket_message_streamer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Engineering-Research-and-Development/true-connector-websocket_message_streamer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Ftrue-connector-websocket_message_streamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Ftrue-connector-websocket_message_streamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Ftrue-connector-websocket_message_streamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Ftrue-connector-websocket_message_streamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Engineering-Research-and-Development","download_url":"https://codeload.github.com/Engineering-Research-and-Development/true-connector-websocket_message_streamer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Engineering-Research-and-Development%2Ftrue-connector-websocket_message_streamer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32878493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-27T21:24:51.864Z","updated_at":"2026-05-11T02:20:27.877Z","avatar_url":"https://github.com/Engineering-Research-and-Development.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSocket Message Streamer\n\n## Installation\nClone the repo and launch `mvn install`\n\nIn a maven project include this dependency: \n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eit.eng.idsa\u003c/groupId\u003e\n    \u003cartifactId\u003ewebsocket-message-streamer\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n## Usage\n\nCopy config.properties file to resource folder of application which is using this library.\n\nContent of the *config.properties* file:\n\n```\n### App setup\nserver.ssl.key-password=changeit\nserver.ssl.key-store=/cert/ssl-server.jks\nserver.ssl.port=9000\nserver.path=/incoming-data-channel-received-message\n# Timer in ms\napplication.recreation.frequency=1000\n```\nModify values for keystore password and location of jks file, according your configuration.\n\n\nIn the Bootstrap of your application `init` the library in this way (**Spring Boot** not required):\n\n```\n@Configuration\npublic class WebSockeMessageStreamerConfig {\n\n    @Bean\n    public FileRecreatorBeanExecutor fileRecreatorBeanTimer() throws SchedulerException {\n       FileRecreatorBeanExecutor fileRecreatorBeanExecutor = WebSocketServerManager.fileRecreatorBeanExecutor();\n              fileRecreatorBeanExecutor.setPort(9060); //optional default 9000\n              fileRecreatorBeanExecutor.setKeystorePassword(\"server.jks\"); //optional default classpath: ssl-server.jks\n              fileRecreatorBeanExecutor.setKeystorePassword(\"password\");\n              fileRecreatorBeanExecutor.trigger();  \n        return fileRecreatorBeanExecutor;\n    }\n\n      @Bean\n        public IncomingDataAppResourceOverWs incomingDataAppResourceOverWs(){\n            IncomingDataAppResourceOverWs incomingDataAppResourceOverWs = new IncomingDataAppResourceOverWs();\n            WebSocketServerManager.messageWebSocketResponse().addPropertyChangeListener(incomingDataAppResourceOverWs);\n            return incomingDataAppResourceOverWs;\n        }\n}\n\n```\nExample of class to manage the `Response` arrived from Server: \n\n```\npublic class IncomingDataAppResourceOverWs implements PropertyChangeListener {\n\n    private String responseMessage;\n\n    public String getResponseMessage() {\n        return responseMessage;\n    }\n\n    public void setResponseMessage(String responseMessage) {\n        this.responseMessage = responseMessage;\n    }\n\n    @Override\n    public void propertyChange(PropertyChangeEvent evt) {\n        this.setResponseMessage((String) evt.getNewValue());\n        WebSocketServerManager.messageWebSocketResponse().sendResponse(createDummyResponse(getResponseMessage()));\n    }\n\n\n    private String createDummyResponse(String responseMessage) {\n        String responseString = null;\n        try {\n            String header = \"A simple Header\";\n            // Put check sum in the payload\n            String payload = \"{\\\"checksum\\\":\\\"ABC123\\\"}\";\n            // prepare multipart message.\n            responseString = new MultiPartMessage.Builder()\n                    .setHeader(header)\n                    .setPayload(payload)\n                    .build()\n                    .toString();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        return responseString;\n    }\n}\n\n```\n\n\nIn A Rest Api or wherever you need, use the WS Client in this way:\n\n```\n @PostMapping(\"/sendFile\")\n    @ResponseBody\n    public String sendFile(@RequestHeader(\"Forward-To\") String forwardTo, @RequestBody String fileName) throws Exception {\n        Resource resource = resourceLoader.getResource(\"classpath:examples-multipart-messages/\" + fileName);\n        return WebSocketClientManager.messageWebSocketSender().sendMultipartMessageWebSocketOverHttps(resource.getFile(), forwardTo);\n    }\n\n```\n\n`forward-To` is the address of a WS Server.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering-research-and-development%2Ftrue-connector-websocket_message_streamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineering-research-and-development%2Ftrue-connector-websocket_message_streamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineering-research-and-development%2Ftrue-connector-websocket_message_streamer/lists"}