Showing results for 
Search instead for 
Did you mean: 

Reactive + Spring boot + Neo4j multiple db - unable to detect customized driver configuration

We are trying to configure two different neo4j db instance of same URI in reactive spring boot application. We have configured two different configuration as well. One of the configuration mentioned below but it's not detecting the configuration rather it's only considered what database mentioned in application.yml file i.e. If we don't mentioned this in yml file then it's inserting into default neo4j db. Although we have hardcoded the db in configuration file but it's not picking that.

@Configuration(proxyBeanMethods = false)
        basePackageClasses = OceanNeo4jConfiguration.class,
        neo4jMappingContextRef = "oceanContext",
        transactionManagerRef = "oceanManager")

public class OceanNeo4jConfiguration {

    public Driver oceanDriver(Neo4jProperties oceanProperties) {
        var authentication = oceanProperties.getAuthentication();
        return GraphDatabase.driver(oceanProperties.getUri(), AuthTokens.basic(
                authentication.getUsername(), authentication
                        .withMaxConnectionLifetime(3, TimeUnit.MINUTES)

    public ReactiveTransactionManager oceanManager(
            Driver driver,
            ReactiveDatabaseSelectionProvider oceanSelection) {
        return new ReactiveNeo4jTransactionManager(driver, oceanSelection);

    public ReactiveDatabaseSelectionProvider oceanSelection(
            Neo4jDataProperties oceanDataProperties) {
        return () -> Mono.just(DatabaseSelection.byName("ocean"));

    public Neo4jMappingContext oceanContext(ResourceLoader resourceLoader, Neo4jConversions neo4jConversions)
            throws ClassNotFoundException {
        Neo4jMappingContext context = new Neo4jMappingContext(neo4jConversions);
        return context;
Nodes 2022
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.