{"id":20877441,"url":"https://github.com/t1/jee-parallel-stream-http-demo","last_synced_at":"2026-04-28T02:31:17.775Z","repository":{"id":165579263,"uuid":"639958639","full_name":"t1/jee-parallel-stream-http-demo","owner":"t1","description":"Experiments with parallel streams of Jakarta EE managed threads doing http requests","archived":false,"fork":false,"pushed_at":"2026-03-11T09:13:03.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2026-03-11T16:06:22.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/t1.png","metadata":{"files":{"readme":"README.adoc","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-12T16:10:17.000Z","updated_at":"2026-03-11T09:13:06.000Z","dependencies_parsed_at":"2023-11-30T07:24:49.276Z","dependency_job_id":"708555ad-567e-41ff-9563-fdb129503570","html_url":"https://github.com/t1/jee-parallel-stream-http-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t1/jee-parallel-stream-http-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fjee-parallel-stream-http-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fjee-parallel-stream-http-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fjee-parallel-stream-http-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fjee-parallel-stream-http-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1","download_url":"https://codeload.github.com/t1/jee-parallel-stream-http-demo/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fjee-parallel-stream-http-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32363627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":"2024-11-18T06:57:02.576Z","updated_at":"2026-04-28T02:31:17.758Z","avatar_url":"https://github.com/t1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Jakarta EE Parallel Stream Http Demo\n\nExperiments with parallel streams of Jakarta EE managed threads doing http requests.\n\nIt has two REST resources:\n\n|===\n|URL |Result\n\n|http://localhost:8080/\\{n}plus\\{m}\n|the sum of `n` and `m`\n\n|http://localhost:8080/sum\\{n}\n|the sum of a stream of 1 to `n`, adding 1 to every element, e.g. `sum2` = 5\n|===\n\nThe `sum` resource does `n` parallel http requests to the `plus` resource.\n\nAs I understand the https://jakarta.ee/specifications/concurrency/3.0/jakarta-concurrency-spec-3.0.html#managedthreadfactory[Jakarta Concurrency Spec 3.0] (esp. the Javadoc of the https://jakarta.ee/specifications/concurrency/3.0/apidocs/jakarta/enterprise/concurrent/managedthreadfactory[ManagedThreadFactory] class), this should be possible (as I've implemented in `Parallel.java`):\n\n* Inject a `ManagedThreadFactory` via `@Resource`.\n* Create a `ForkJoinPool` based on that.\n* Submit tasks to that pool.\n* Tasks are managed and can access, e.g., `@RequestScoped` beans.\n\nI can see that the worker threads are not from the common pool, so I'd assume that they are actually managed.\nBut it fails on WildFly with `WELD-001303: No active contexts for scope type jakarta.enterprise.context.RequestScoped`.\n\nIf I do it in a traditional way (i.e. with a non-parallel stream and an intermediate `.toList().stream()`), it works.\n\n*Please correct me if I'm wrong!*\n\nTo reproduce it, just run `mvn wildfly:dev` and call `http://localhost/sum2`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fjee-parallel-stream-http-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1%2Fjee-parallel-stream-http-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fjee-parallel-stream-http-demo/lists"}