fix(deps): update dependency org.neo4j.driver:neo4j-java-driver to v6 #409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.28.10
->6.0.1
Release Notes
neo4j/neo4j-java-driver (org.neo4j.driver:neo4j-java-driver)
v6.0.1
Compare Source
The
neo4j-java-driver-bom
has been updated to not importnetty-bom
.If you are using Netty Native Transport, please ensure to either:
netty-bom
with the desired Netty version (at present, the driver is shipped with Netty 4.2+)6.0 API documentation
👏 Improvements
v6.0.0
Compare Source
This release brings news features, general improvements and dependency updates.
The sections below describe the main updates in this release and the full changelog is listed in the end.
Java Driver Manual
6.0 API documentation
Neo4j Vector
Neo4j Vector is a new data type introduced in Neo4j server (2025.10, Enterprise Edition).
The driver's type system has been extended to support it.
A new
Vector
interface represents Neo4j Vector. At present, it has 6 subtypes:Int8Vector
-INTEGER8
vector that has Javabyte
elements and can be converted tobyte[]
arrayInt16Vector
-INTEGER16
vector that has Javashort
elements and can be converted toshort[]
arrayInt32Vector
-INTEGER32
vector that has Javaint
elements and can be converted toint[]
arrayInt64Vector
-INTEGER
vector that has Javalong
elements and can be converted tolong[]
arrayFloat32Vector
-FLOAT16
vector that has Javafloat
elements and can be converted tofloat[]
arrayFloat64Vector
-FLOAT
vector that has Javadouble
elements and can be converted todouble[]
arraySimilarly to the
IsoDuration
, newValue
instance containingVector
can be created using one of the providedValues#vector(...)
factory methods. TheType
of suchValue
is equal toTypeSystem#VECTOR()
.Usage example:
Since
Vector
is asealed
interface, it works well with Pattern Matching for switch:Alongside
Value#asVector()
, it is also possible to mapValue
toVector
using theValue#as(Class<T>)
method. This is especially useful whenVector
subtype is well-known:It is also possible to map to array directly:
When using Object Mapping, it is possible to define
record
components both asVector
and arrays withVector
annotation:Unsupported Type
The Neo4j Vector is a good example of a new type being introduced to the system. It is possible that at some point the driver version connecting to the server might not support a new future type because it requires a newer protocol version to support it.
A new
UnsupportedType
object has been introduced to identify such types and provide some information about them, like:The
Type
of aValue
withUnsupportedType
is equal toTypeSystem#UNSUPPORTED()
.Usage example:
Sending the
UnsupportedType
back to the server is not supported.Bill of Materials (BOM)
A new Maven artifact
neo4j-java-driver-bom
represents driver's Bill of Materials (BOM).It is especially useful when additional driver dependencies are used.
Usage example (Maven):
The driver BOM also imports
netty-bom
to ensure compatible versions, especially when Netty Native Transport is used.Should it be necessary, users can override
netty-bom
version by importing it before the driver BOM:Query API
NOTE: This feature is in preview.
Neo4j Query API is an HTTP API for executing Cypher statements.
The driver supports connecting to this API over HTTP.
The Query API support is enabled by:
https
orhttp
URI schemeExample (Maven):
Driver creation example:
The are some limitations with this integration at the moment. The main unsuported items are listed below:
ResultSummary#resultAvailableAfter(TimeUnit)
.ResultSummary#resultConsumedAfter(TimeUnit)
.ResultSummary#queryType()
.ResultSummary#plan()
.ResultSummary#profile()
.Since home database resolution is not supported, the database name MUST be set explicitly using the driver API. Alternatively, it is possible to append the default database name to the URI, it will be used when no database name is set explicitly.
Example:
https://query.api.local?defaultDatabase=neo4j
Reducing the number of dependencies
When the driver is used with Query API only, it is possible to exclude some dependencies to reduce the overall amount:
Specifically, this removes the following dependencies:
Unix Domain Socket
bolt+unix
URI scheme allows connecting to Neo4j server over Unix Domain Socket.Example:
While the driver does not impose any special limitations on such connections, the server has a dedicated purpose for them - administration. Therefore, it limits interations to
system
database only. See the server configuration settings.Netty Native Transport
Using Netty Native Transport may bring better performance and less garbage collection as mentioned in the Netty documentation.
In addition, TFO is only supported with Netty Native Transport.
The native transport support is limited to the following URI schemes:
neo4j
bolt
Only the following Maven artifacts are supported:
netty-transport-native-io_uring
(Netty 4.2+ only)netty-transport-native-epoll
netty-transport-native-kqueue
The driver automatically uses Netty Native Transport when it is added to runtime.
Example (Maven):
TCP Fast Open (TFO)
NOTE: This feature is experimental.
A working TCP Fast Open setup enables the driver to start one of the following during TCP handshake by sending early data:
The following conditions MUST be met for it to work as expected:
The driver configuration example:
Logging
The driver now uses Java System.Logger by default.
The
Logging
abstraction has been deprecated for future removal.Since Java
System.Logger
uses Java Util Logging (JUL) by default, logging can be adjusted by modifying$JAVA_HOME/conf/loggig.properties
file.There are 2 main root loggers that the driver uses:
org.neo4j.driver
- Driver-level logging.org.neo4j.bolt.connection
- Bolt-level logging.For instance, to see driver logging in console:
java.util.logging.ConsoleHandler.level
is set to the desired logging level.Example:
Both
System.Logger
and JUL can be bridged to other logging solutions should this be needed.Observability
NOTE: This feature is in preview.
Observability of the driver has been improved in this release.
A new
ObservationProvider
type provides an integration point for driver observability. There are 2 new driver modules that implement it:neo4j-java-driver-observation-metrics
neo4j-java-driver-observation-micrometer
The former contains the experimental metrics that the driver used to have previously. They have been moved to this new module.
The latter implements integration with Mictomer Observation API. Micrometer is able to create both metrics and traces providing that the relevant handlers are registered.
See #1682 for more details.
Acquisition timeout
The handling of
ConfigBuilder#withConnectionAcquisitionTimeout(long, TimeUnit)
has been changed to apply to the whole connection acquisition process. Please see the documentation for more details.Changelog
Please see the full changelog below.
⭐ New Features
👏 Improvements
🔧 Dependency Management
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.