micronaut-projects / micronaut-eclipsestore

Apache License 2.0
1 stars 2 forks source link

Automatic bean discovery for multiple named eclipsestore-Root-providers #98

Open cloudwy opened 2 months ago

cloudwy commented 2 months ago

Feature description

I want to add two eclipse store databases and it was failed when trying to create two different root providers.

application.yml

eclipsestore:
    storage:
        dependency:
            root-class: example.micronaut.dependency.DependencyContainer
            storage-directory: build/eclipsestore/dependencies
            channel_count: 4
        fruit:
            root-class: example.micronaut.fruits.FruitContainer
            storage-directory: build/eclipsestore/fruit
            channel_count: 4

FruitRepositoryImpl.java

FruitRepositoryImpl( RootProvider<FruitContainer> rootProvider) { 
        this.rootProvider = rootProvider;
    }

I thought that micronaut will discover the bean automatically, because the root provider type-definition matches to the defined root class in the eclipsestore setting.

But now I need to add @Named("fruit") annotation to make it work, could you please add some information in the tutorial or implement automatic bean discovery?