Skip to content

Should make annotation easier to use in multiple items circumstance. #3039

Closed
@chickenlj

Description

By default, annotation does not support reading of multi-items for one config type, for example:

dubbo.application.name=demo-provider
dubbo.registries.registry1.id=aaa
dubbo.registries.registry1.address=zookeeper://127.0.0.1:2181
dubbo.registries.registry2.id=bbb
dubbo.registries.registry2.address=zookeeper://127.0.0.1:2181

We can open multi config support by add the following annotation
@EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.action", multipleConfig = true)

   @Configuration
    @EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.action", multipleConfig = true)
    @PropertySource("classpath:/spring/dubbo-consumer.properties")
    @ComponentScan(value = {"org.apache.dubbo.samples.annotation.action"})
    static public class ConsumerConfiguration {}

Now, the dubbo.registries. works fine, but here comes a new problem, dubbo.application. can not work with multiConfig=true. To make it work, we must change it to dubbo.applications.id1.name=demo-provider.

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions