{"id":23338445,"url":"https://github.com/abhirockzz/cdi-async-events","last_synced_at":"2026-02-26T09:51:23.420Z","repository":{"id":79124863,"uuid":"93958054","full_name":"abhirockzz/cdi-async-events","owner":"abhirockzz","description":"Asynchronous events in CDI 2.0","archived":false,"fork":false,"pushed_at":"2017-06-16T12:00:51.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T03:22:01.333Z","etag":null,"topics":["asynchronous","cdi","concurrency","docker","executor-service","glassfish5","javaee8","jsr","server-sent-events"],"latest_commit_sha":null,"homepage":"https://abhirockzz.wordpress.com/2017/06/11/cdi-2-0-async-events/","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-06-10T18:27:19.000Z","updated_at":"2017-07-24T23:31:00.000Z","dependencies_parsed_at":"2023-03-13T20:10:56.565Z","dependency_job_id":null,"html_url":"https://github.com/abhirockzz/cdi-async-events","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fcdi-async-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fcdi-async-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fcdi-async-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhirockzz%2Fcdi-async-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhirockzz","download_url":"https://codeload.github.com/abhirockzz/cdi-async-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240258162,"owners_count":19772969,"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","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":["asynchronous","cdi","concurrency","docker","executor-service","glassfish5","javaee8","jsr","server-sent-events"],"created_at":"2024-12-21T03:13:57.195Z","updated_at":"2026-02-26T09:51:18.390Z","avatar_url":"https://github.com/abhirockzz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## To run....\r\n\r\n- `git clone https://github.com/abhirockzz/cdi-async-events.git` \r\n- `mvn clean install`\r\n- `docker build -t abhirockzz/gf5-nightly -f Dockerfile_gf5_nightly .`\r\n- `docker build -t abhirockzz/gf5-cdi-example -f Dockerfile_app .`\r\n- `docker run --rm --name gf5cdi -it -p 8080:8080 -p 4848:4848 -p 8181:8181 abhirockzz/gf5-nightly-cdi-example`\r\n- what's the Docker host IP ? `docker-machine ip` (e.g. 192.168.99.100)\r\n\r\n## Test it...\r\n\r\n- `http://\u003cdocker_ip\u003e:8080/cdi-async-events/events/subscribe`. You should see a continuous stream of (SSE) events\r\n\r\n![](https://abhirockzz.files.wordpress.com/2017/06/sse-output.jpg)\r\n\r\n- Pick a [Websocket client](https://chrome.google.com/webstore/detail/simple-websocket-client/pfdhoblngboilpfeibdedpjgfnlcodoo?hl=en) and use it connect to the Websocket endpoint `ws://\u003cdocker_ip\u003e:8080/cdi-async-events/`. You will see the same event stream...\r\n\r\n![](https://abhirockzz.files.wordpress.com/2017/06/websocket-output.jpg)\r\n\r\n*Try this with multiple clients - for both SSE and Websocket*. Console logs show the asynchronous nature of CDI events\r\n\r\nNotice the asynchronous events running in Managed Executor service thread\r\n\r\n![](https://abhirockzz.files.wordpress.com/2017/06/action-2.jpg)\r\n\r\nYou can choose to let things run in the default (container) chosen thread\r\n\r\n![](https://abhirockzz.files.wordpress.com/2017/06/cdi-2-async-events-in-action.jpg)\r\n\r\n## once you're done\r\n\r\n`docker stop gf5cdi`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fcdi-async-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhirockzz%2Fcdi-async-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhirockzz%2Fcdi-async-events/lists"}