{"id":15426047,"url":"https://github.com/candrews/java-httpclient-webclient-spring-boot-starter","last_synced_at":"2025-04-19T16:19:29.414Z","repository":{"id":57725291,"uuid":"301526480","full_name":"candrews/java-httpclient-webclient-spring-boot-starter","owner":"candrews","description":"JDK 11 HttpClient integration for Spring WebClient","archived":false,"fork":false,"pushed_at":"2020-10-09T19:36:35.000Z","size":137,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T10:03:37.349Z","etag":null,"topics":["hacktoberfest","java","java-httpclient","spring","spring-boot","spring-webclient","springboot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/candrews.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-05T20:05:07.000Z","updated_at":"2021-12-11T06:14:40.000Z","dependencies_parsed_at":"2022-09-11T20:30:19.268Z","dependency_job_id":null,"html_url":"https://github.com/candrews/java-httpclient-webclient-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candrews%2Fjava-httpclient-webclient-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candrews%2Fjava-httpclient-webclient-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candrews%2Fjava-httpclient-webclient-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candrews%2Fjava-httpclient-webclient-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candrews","download_url":"https://codeload.github.com/candrews/java-httpclient-webclient-spring-boot-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249736549,"owners_count":21318264,"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":["hacktoberfest","java","java-httpclient","spring","spring-boot","spring-webclient","springboot"],"created_at":"2024-10-01T17:54:41.452Z","updated_at":"2025-04-19T16:19:29.387Z","avatar_url":"https://github.com/candrews.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java HttpClient for Spring Web Client Boot Starter\n[![javadoc](https://javadoc.io/badge2/com.integralblue/java-httpclient-webclient-spring-boot-starter/javadoc.svg)](https://javadoc.io/doc/com.integralblue/java-httpclient-webclient-spring-boot-starter)\n[![Maven Central](https://img.shields.io/maven-central/v/com.integralblue/java-httpclient-webclient-spring-boot-starter)](https://search.maven.org/artifact/com.integralblue/java-httpclient-webclient-spring-boot-starter)\n![GitHub](https://img.shields.io/github/license/candrews/java-httpclient-webclient-spring-boot-starter)\n\nThe Java HttpClient for Spring Web Client Boot Starter provides a quick and easy way to use [Java 11's HttpClient](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpClient.html) as [Spring WebClient's](https://docs.spring.io/spring-boot/docs/2.3.4.RELEASE/reference/htmlsingle/#boot-features-webclient) client HTTP connector.\n\nBy default, [Spring WebClient will try to use Reactor Netty then Jetty Client as it's client HTTP connector](https://docs.spring.io/spring-boot/docs/2.3.4.RELEASE/reference/htmlsingle/#boot-features-webclient-runtime). This starter will instead use Java 11's HTTP client.\n\nBenefits of using this starter include:\n* not needing additional dependencies such as on Netty or Eclipse\n* getting the benefits and features of Java's built in HttpClient\n* Being able to use tooling for Java's HttpClient, such as [HttpClientMock](https://github.com/PGSSoft/HttpClientMock)\n\n## Using This Starter\nTo use this starter, you need:\n* Java 11 (or later)\n* Spring Boot 2.3.0 (or later)\n* Spring WebClient, which is included in Spring WebFlux\n\n### Add the Dependency\n\nAdd a dependency on this starter your dependency manager of choice, making sure to use the latest version: ![Maven Central](https://img.shields.io/maven-central/v/com.integralblue/java-httpclient-webclient-spring-boot-starter)\n\nFor Gradle:\n```groovy\ndependencies {\n\truntimeOnly 'com.integralblue:java-httpclient-webclient-spring-boot-starter:VERSION'\n}\n```\n\nFor Maven:\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.integralblue\u003c/groupId\u003e\n\t\u003cartifactId\u003ejava-httpclient-webclient-spring-boot-starter\u003c/artifactId\u003e\n\t\u003cversion\u003eVERSION\u003c/version\u003e\n    \u003cscope\u003eruntime\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Use the Autowired WebClient.Builder\n\nFollow the advice given in the Spring Boot documentation under [Calling REST Services with WebClient](https://docs.spring.io/spring-boot/docs/2.3.4.RELEASE/reference/htmlsingle/#boot-features-webclient) when using `WebClient` by autowiring an instance of `WebClient.Builder` and using that to create the `WebClient` instance.\n\nFor example:\n```java\n@Service\npublic class MyService {\n\n    private final WebClient webClient;\n\n    public MyService(WebClient.Builder webClientBuilder) {\n        this.webClient = webClientBuilder.baseUrl(\"https://example.org\").build();\n    }\n\n    public Mono\u003cDetails\u003e someRestCall(String name) {\n        return this.webClient.get().uri(\"/{name}/details\", name)\n                        .retrieve().bodyToMono(Details.class);\n    }\n```\n\n`WebClient.create()` and `WebClient.builder().build()` will not apply the customizations from this starter meaning `WebClient`s created using those approaches will not use Java 11's HttpClient.\n\n## Future of This Starter\nEventually, a future version of Spring will likely include this functionality. Follow [the Pull Request for JDK 11 HttpClient integration with WebClient](https://github.com/spring-projects/spring-framework/pull/23432/) for more information.\n\n## Developing the Starter\nThis project requires Java 11 (or later).\nImport this Gradle project using your IDE of choice.\nOr, if you don't want to use an IDE, you can run the project from the command line: `./gradlew build` The test suite will run and a jar will be output at [build/libs/](build/libs/).\n\n### Eclipse\nThe Project Lombok Eclipse integration must be setup. See the Eclipse instructions on [Project Lombok's site](https://projectlombok.org/features/index.html).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandrews%2Fjava-httpclient-webclient-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandrews%2Fjava-httpclient-webclient-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandrews%2Fjava-httpclient-webclient-spring-boot-starter/lists"}