{"id":18559052,"url":"https://github.com/linux-china/spring-boot-virtual-thread-demo","last_synced_at":"2025-04-28T11:28:11.623Z","repository":{"id":175235647,"uuid":"653554525","full_name":"linux-china/spring-boot-virtual-thread-demo","owner":"linux-china","description":"Spring Boot Virtual Thread demo with Tomcat","archived":false,"fork":false,"pushed_at":"2025-03-24T05:50:19.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-26T12:13:16.933Z","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/linux-china.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":"2023-06-14T09:21:01.000Z","updated_at":"2025-03-24T05:50:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb36e57d-1019-4a6b-aee1-1004933f2d37","html_url":"https://github.com/linux-china/spring-boot-virtual-thread-demo","commit_stats":null,"previous_names":["linux-china/spring-boot-virtual-thread-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-virtual-thread-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-virtual-thread-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-virtual-thread-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fspring-boot-virtual-thread-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/spring-boot-virtual-thread-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251304074,"owners_count":21567801,"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":[],"created_at":"2024-11-06T21:41:56.198Z","updated_at":"2025-04-28T11:28:11.606Z","avatar_url":"https://github.com/linux-china.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Spring Boot Virtual Thread Demo\n==================================\n\nSpring Boot Virtual Thread Demo with Tomcat.\n\n* Java 21: https://jdk.java.net/21/\n* Spring Boot 3.2.0 with Tomcat 10.1.16\n\n# Tomcat Virtual Threads Configuration\n          \nPlease add following configuration to `application.properties`:\n\n```properties\nspring.threads.virtual.enabled=true\n```\n\n# Reactive on Virtual Threads\n\n```\n    @GetMapping(\"/reactive\")\n    public Mono\u003cString\u003e reactive() {\n        return Mono.just(\"Hello Reactor!\").doOnNext(s -\u003e {\n            System.out.println(\"Reactive on \" + Thread.currentThread());\n        });\n    }\n```\n\n# Async method on Virtual Threads\n\nAdd `@EnableAsync` on Spring Boot main class, then add `@Async` on method.\n\n# References\n\n* JDK 21: https://openjdk.org/projects/jdk/21/\n* JEP 444: Virtual Threads - https://openjdk.org/jeps/444\n* Spring Boot Asynchronous Requests: https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-ann-async.html\n* Apache Tomcat 10.1.10 available: https://lists.apache.org/thread/20lp6fcf5c0gb5p32k9vwl8xbscc1h68\n* Embracing Virtual Threads: https://spring.io/blog/2022/10/11/embracing-virtual-threads\n* Working with Virtual Threads in Spring 6: https://www.baeldung.com/spring-6-virtual-threads\n* When virtual threads are enabled, configure Jetty to use\n  them: https://github.com/spring-projects/spring-boot/issues/35703\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-boot-virtual-thread-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fspring-boot-virtual-thread-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fspring-boot-virtual-thread-demo/lists"}