|
| 1 | +--- |
| 2 | +title: "RDF4J 6.0.0 Milestone 1" |
| 3 | +date: 2026-04-24T14:38:22+0200 |
| 4 | +layout: "single" |
| 5 | +categories: ["news"] |
| 6 | +--- |
| 7 | +Milestone number 1 of the upcoming 6.0.0 release of RDF4J is now available for download. |
| 8 | + |
| 9 | +RDF4J 6.0.0 is a major release of the RDF4J framework, focusing on dependency upgrades, LMDB |
| 10 | +improvements, and HTTP client improvements. |
| 11 | + |
| 12 | +Please note that RDF4J 6.0.0-M1 requires Java 25. |
| 13 | + |
| 14 | +Some of the highlights covered in this first milestone: |
| 15 | + |
| 16 | +- Upgrade to Java 25 as the minimally-required version of Java |
| 17 | +- Introduction of a pluggable HTTP client SPI with Apache HttpComponents 5 and JDK built-in backends |
| 18 | +- Migration from Apache HttpComponents 4 to the new HTTP client facade |
| 19 | + |
| 20 | +This milestone build is not yet feature-complete, but we are putting it out to receive early feedback on all the improvements we have put in. |
| 21 | + |
| 22 | +<!--more--> |
| 23 | + |
| 24 | + - [issues fixed in 6.0.0 Milestone 1](https://github.com/eclipse-rdf4j/rdf4j/issues?q=is%3Aissue+label%3AM1+is%3Aclosed+milestone%3A6.0.0) |
| 25 | + - [issues planned for 6.0.0](https://github.com/eclipse-rdf4j/rdf4j/milestone/128) |
| 26 | + |
| 27 | +## Upgrade notes |
| 28 | + |
| 29 | +RDF4J 6.0.0 contains several [backward incompatible changes](https://github.com/eclipse-rdf4j/rdf4j/issues?q=is%3Aclosed+is%3Aissue+label%3A%22%E2%9B%94+Not+backwards+compatible%22+milestone%3A6.0.0). |
| 30 | + |
| 31 | +### HTTP client migration |
| 32 | + |
| 33 | +RDF4J previously used Apache HttpComponents 4 as its sole HTTP client, with Apache HttpComponents 4 types |
| 34 | +directly exposed in the public API. In 6.0.0, this dependency has been replaced by a new |
| 35 | +HTTP-client-agnostic facade. Apache HttpComponents 4 is no longer exposed through the `rdf4j-http-client` |
| 36 | +public API or required as a transitive dependency of `rdf4j-http-client` for standard use. |
| 37 | + |
| 38 | +For most users, no dependency changes are required. The `rdf4j-http-client` artifact continues to bundle both |
| 39 | +built-in backend implementations as runtime dependencies, so upgrading the RDF4J version is sufficient for |
| 40 | +standard use cases. |
| 41 | + |
| 42 | +Two HTTP client backends are now available: |
| 43 | + |
| 44 | +- Apache HttpComponents 5 (`rdf4j-http-client-apache5`) - the default backend when on the classpath. |
| 45 | +- JDK built-in HTTP client (`rdf4j-http-client-jdk`) - a zero-dependency alternative using the JDK |
| 46 | + `java.net.http.HttpClient` API. |
| 47 | + |
| 48 | +To select a specific backend, set the `rdf4j.http.client.factory` system property to either `apache5` or |
| 49 | +`jdk`: |
| 50 | + |
| 51 | +```bash |
| 52 | +-Drdf4j.http.client.factory=jdk |
| 53 | +``` |
| 54 | + |
| 55 | +If you previously configured connection pooling or timeouts via system properties on |
| 56 | +`SharedHttpClientSessionManager`, those properties are still supported: |
| 57 | + |
| 58 | +- `org.eclipse.rdf4j.client.http.maxConnPerRoute` (default: 25) |
| 59 | +- `org.eclipse.rdf4j.client.http.maxConnTotal` (default: 50) |
| 60 | +- `org.eclipse.rdf4j.client.http.connectionTimeout` (default: 30 000 ms) |
| 61 | +- `org.eclipse.rdf4j.client.http.connectionRequestTimeout` |
| 62 | + |
| 63 | +For a minimal-footprint deployment without Apache HttpComponents 5, exclude `rdf4j-http-client-apache5` and |
| 64 | +ensure `rdf4j-http-client-jdk` is on the classpath. |
| 65 | + |
| 66 | +### Developer-facing changes |
| 67 | + |
| 68 | +The following public API methods previously exposed `org.apache.http.client.HttpClient` from Apache |
| 69 | +HttpComponents 4 and have been replaced ([GH-5723](https://github.com/eclipse-rdf4j/rdf4j/issues/5723)): |
| 70 | + |
| 71 | +| Old method | Replacement | |
| 72 | +| --- | --- | |
| 73 | +| `HttpClientDependent#getHttpClient()` returns `org.apache.http.client.HttpClient` | Returns `org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient` | |
| 74 | +| `HttpClientDependent#setHttpClient(HttpClient)` | Accepts `org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient` | |
| 75 | +| `HttpClientSessionManager#getHttpClient()` returns `org.apache.http.client.HttpClient` | Returns `org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient` | |
| 76 | + |
| 77 | +If your code calls `setHttpClient()` with a custom Apache HttpComponents 4 client, you must migrate to the |
| 78 | +new API. |
| 79 | + |
| 80 | +The new `rdf4j-http-client-api` module defines the HTTP client facade with no third-party HTTP dependencies. |
| 81 | +The key types are: |
| 82 | + |
| 83 | +- `RDF4JHttpClientFactory` - SPI interface discovered via `java.util.ServiceLoader`; implement this to plug in |
| 84 | + a custom HTTP backend. |
| 85 | +- `RDF4JHttpClient` - the HTTP client interface used internally by `SPARQLProtocolSession` and |
| 86 | + `RDF4JProtocolSession`. |
| 87 | +- `RDF4JHttpClientConfig` - immutable configuration object for timeouts, connection pooling, SSL, and default |
| 88 | + headers. |
| 89 | +- `RDF4JHttpClients` - utility class for obtaining the default factory or creating clients. |
| 90 | + |
| 91 | +Use `RDF4JHttpClientConfig` and `RDF4JHttpClients` to create a configured client and pass it to a repository |
| 92 | +or session: |
| 93 | + |
| 94 | +```java |
| 95 | +RDF4JHttpClientConfig config = RDF4JHttpClientConfig.newBuilder() |
| 96 | + .connectTimeoutMs(5_000) |
| 97 | + .socketTimeoutMs(30_000) |
| 98 | + .maxConnectionsPerRoute(10) |
| 99 | + .build(); |
| 100 | + |
| 101 | +RDF4JHttpClient client = RDF4JHttpClients.newDefaultClient(config); |
| 102 | + |
| 103 | +HTTPRepository repo = new HTTPRepository("http://localhost:8080/rdf4j-server/repositories/myrepo"); |
| 104 | +repo.setHttpClient(client); |
| 105 | +``` |
| 106 | + |
| 107 | +The previous `HttpClientBuilders.getSSLTrustAllHttpClientBuilder()` helper, which returned an Apache |
| 108 | +HttpComponents 4 builder, has been replaced by `HttpClientBuilders.getSslTrustAllConfig()`: |
| 109 | + |
| 110 | +```java |
| 111 | +RDF4JHttpClientConfig config = HttpClientBuilders.getSslTrustAllConfig(); |
| 112 | +RDF4JHttpClient client = RDF4JHttpClients.newDefaultClient(config); |
| 113 | +repo.setHttpClient(client); |
| 114 | +``` |
| 115 | + |
| 116 | +Authentication is now handled via the `AuthenticationHandler` SPI rather than Apache HttpComponents 4 |
| 117 | +credential stores. Built-in implementations are provided for basic authentication and bearer tokens: |
| 118 | + |
| 119 | +```java |
| 120 | +session.setAuthenticationHandler(new BasicAuthenticationHandler("user", "secret")); |
| 121 | +session.setAuthenticationHandler(new BearerTokenAuthenticationHandler("my-token")); |
| 122 | +session.setAuthenticationHandler(new BearerTokenAuthenticationHandler(tokenStore::currentToken)); |
| 123 | +``` |
| 124 | + |
| 125 | +To provide a fully custom HTTP backend, implement `RDF4JHttpClientFactory` and register it as a |
| 126 | +`java.util.ServiceLoader` service in |
| 127 | +`META-INF/services/org.eclipse.rdf4j.http.client.spi.RDF4JHttpClientFactory`. To extend the Apache |
| 128 | +HttpComponents 5 backend with additional configuration, subclass `ApacheHC5RDF4JHttpClientFactory` and |
| 129 | +override `buildHttpClient(HttpClientBuilder, RDF4JHttpClientConfig)`. |
| 130 | + |
| 131 | +### Links |
| 132 | + |
| 133 | +- [Download RDF4J](/download/) |
0 commit comments