Skip to content

Commit

Permalink
Always use bolt scheme in pools
Browse files Browse the repository at this point in the history
  • Loading branch information
madchicken committed Jan 8, 2025
1 parent 1ffcccc commit 8c7afc4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/src/routing/connection_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ impl ConnectionRegistry {
let registry = &self.connections;
let servers = routing_table.resolve();
let url = NeoUrl::parse(self.config.uri.as_str())?;
// Convert neo4j scheme to bolt scheme to create connection pools
let scheme = match url.scheme() {
"neo4j" => "bolt",
"neo4j+s" => "bolt+s",
"neo4j+ssc" => "bolt+ssc",
_ => return Err(Error::UnsupportedScheme(url.scheme().to_string())),
};

for server in servers.iter() {
if registry.contains_key(server) {
continue;
}
let uri = format!("{}://{}:{}", url.scheme(), server.address, server.port);
let uri = format!("{}://{}:{}", scheme, server.address, server.port);
debug!("Creating pool for server: {}", uri);
registry.insert(
server.clone(),
Expand Down

0 comments on commit 8c7afc4

Please sign in to comment.