{"id":23338285,"url":"https://github.com/abhirockzz/websocket-ejb","last_synced_at":"2025-10-26T08:42:49.222Z","repository":{"id":79125480,"uuid":"83768505","full_name":"abhirockzz/websocket-ejb","owner":"abhirockzz","description":"Behavior of WebSocket endpoints when decorated with EJB annotations","archived":false,"fork":false,"pushed_at":"2017-03-03T07:25:15.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T13:44:55.038Z","etag":null,"topics":["ejb","glassfish","javaee","jsr356","payara-server","tyrus","websocket"],"latest_commit_sha":null,"homepage":"https://abhirockzz.gitbooks.io/java-websocket-api-handbook/content/","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/abhirockzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-03-03T07:05:25.000Z","updated_at":"2017-03-03T07:25:48.000Z","dependencies_parsed_at":"2023-03-13T20:10:56.155Z","dependency_job_id":null,"html_url":"https://github.com/abhirockzz/websocket-ejb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhirockzz/websocket-ejb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-ejb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-ejb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-ejb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-ejb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/websocket-ejb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fwebsocket-ejb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281079593,"owners_count":26440321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"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":["ejb","glassfish","javaee","jsr356","payara-server","tyrus","websocket"],"created_at":"2024-12-21T03:13:30.531Z","updated_at":"2025-10-26T08:42:49.204Z","avatar_url":"https://github.com/abhirockzz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bunch of tests for scenario where WebSocket endpoints are decorated with EJBs. This is might be helpful when reading through the [EJB integration section of the Java WebSocket API Handbook\r\n](https://abhirockzz.gitbooks.io/java-websocket-api-handbook/content/part-1-tying_in_with_the_java_ee_platform.html#decorating-websocket-endpoints-with-ejb). This helps validate the behavior which might be a source of confusion since there are two specifications at play here. This is not something which is supported by the WebSocket specification but it is supported by [Tyrus](https://tyrus.java.net/) (hence you can try this on [GlassFish](https://glassfish.java.net/) or [Payara](http://www.payara.fish/))\r\n\r\n## Scenarios\r\n\r\n- [case 1](https://github.com/abhirockzz/websocket-ejb/blob/master/tests/src/test/java/io/gitbooks/abhirockzz/jwah/websocketejb/WebSocketEJBTest.java#L70): A new stateless EJB (from the pool) is allocated for a WebSocket client\r\n- [case 2](https://github.com/abhirockzz/websocket-ejb/blob/master/tests/src/test/java/io/gitbooks/abhirockzz/jwah/websocketejb/WebSocketEJBTest.java#L109): A stateless EJB (once allocated) remains attached to a WebSocket client throughout it's lifecycle\r\n- [case 3](https://github.com/abhirockzz/websocket-ejb/blob/master/tests/src/test/java/io/gitbooks/abhirockzz/jwah/websocketejb/WebSocketEJBTest.java#L146): The same Singleton bean instance is used for WebSocket clients (`Session`s)\r\n- [case 4](https://github.com/abhirockzz/websocket-ejb/blob/master/tests/src/test/java/io/gitbooks/abhirockzz/jwah/websocketejb/WebSocketEJBTest.java#L181): A unique Stateful session bean instance is allocated to each unique client\r\n\r\n## Build \u0026 run\r\n\r\nThere are two Maven projects\r\n\r\n- [First one](https://github.com/abhirockzz/websocket-ejb/tree/master/application) is a simple Java EE (WAR) application with EJB-WebSocket endpoints\r\n- The [second one](https://github.com/abhirockzz/websocket-ejb/tree/master/tests) contains the tests\r\n\r\nDownload the project to your machine. To try things out, first build and deploy the application on on GlassFish or Payara\r\n\r\n- cd application\r\n- `mvn clean install`\r\n- deploy.... \r\n\r\nThen, run the tests\r\n\r\n- cd tests\r\n- `mvn test`\r\n\r\nNote: if required, change the host port [here](https://github.com/abhirockzz/websocket-ejb/blob/master/tests/src/test/java/io/gitbooks/abhirockzz/jwah/websocketejb/WebSocketEJBTest.java#L55) before running the tests","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fwebsocket-ejb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Fwebsocket-ejb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fwebsocket-ejb/lists"}