Class NettyBoltConnectionProviderFactory

java.lang.Object
org.neo4j.bolt.connection.netty.NettyBoltConnectionProviderFactory
All Implemented Interfaces:
BoltConnectionProviderFactory

public final class NettyBoltConnectionProviderFactory extends Object implements BoltConnectionProviderFactory
A factory for creating instances of BoltConnectionProvider.

The created instances support the following URI schemes:

  • bolt, bolt+s, bolt+ssc - establishes a BoltConnection to a given address without routing context. In a clustered Neo4j DBMS the absense of routing context instructs the server to NOT carry out server-side routing even if it might be needed. The URI.getQuery() part is prohibited as routing context is not supported.
  • neo4j, neo4j+s, neo4j+ssc - establishes a BoltConnection to a given address with routing context, which is automatically parsed from the connection URI. In a clustered Neo4j DBMS the presence of routing context enables the server to perform server-side routing within the cluster if necessary. Effectively, using these schemes is sufficient for establishing a connection to a clustered Neo4j DBMS that has server-side routing enabled. However, it should NOT be confused with client-side routing that requires more contextual awareness and fits BoltConnectionSource with RoutedBoltConnectionParameters support better.
  • bolt+unix - establishes a BoltConnection to a given Unix Domain Socket without routing context. The URI.getPath() MUST be a valid path to a file (for example: bolt+unix:///var/run/neo4j.sock).
Supported additional parameters:
  • eventLoopGroup - Sets EventLoopGroup to be used instead of creating a new one. Defaults to null.
  • eventLoopThreads - Sets the number of Event Loop threads. Defaults to null. This option is used only when eventLoopGroup is null.
  • localAddress - Sets LocalAddress to be used instead of URI. Defaults to null.
  • clock - Sets the Clock to be used. Defaults to Clock.systemUTC().
  • domainNameResolver - Sets the DomainNameResolver to be used. Defaults to DefaultDomainNameResolver.getInstance().
  • maxVersion - Sets the meximum BoltProtocolVersion that will be negotiated. Defaults to null.
  • nettyTransport - Defines Netty transport to be used. Supported values: auto (default), nio, io_uring (requires adding io_uring dependency explicitly, Netty 4.2+ only), epoll (requires adding epoll dependency explicitly), kqueue (requires adding kqueue dependency explicitly), local. The default auto mode selects local when localAddress is provided, otherwise it attempts to detect if native transport is available in runtime (the dependency needs to be added explicitly) and falls back to nio otherwise. When eventLoopGroup is not null, this option defaults to nio.
  • enableFastOpen - Enables client-side TCP Fast Open if it is available. Supported values: true and false (default). Note that only Netty native transports support this and extra system configuration may be needed. When either native transport or TCP Fast Open is unavaible, this option is ignored and is effectively false.
  • preferredCapabilities - A Set of preferred BoltCapability that should be selected when server offers support for them during Bolt handshake. This set or individual entries in the set are ignored when no support is available or handshake does not support this feature at all.
Since:
4.0.0