Add `EnableDubbo` annotation to dubbo
See original GitHub issue@EnableDubbo
等价于
@DubboComponentScan
与 @EnableDubboConfig
组合:
示例代码
服务端配置
@EnableDubbo(basePackages = "com.alibaba.dubbo.config.spring.context.annotation")
@PropertySource("META-INF/dubbb-provider.properties")
@EnableTransactionManagement
public static class TestProviderConfiguration {
}
dubbo-provider.properties
:
# Dubbo Provider Properties as an alternative for
# Spring XML Bean definition : META-INF/spring/dubbo-annotation-provider.xml
demo.service.application = dubbo-annotation-provider
demo.service.protocol = dubbo
demo.service.registry = my-registry
## Dubbo configs binding properties
### <dubbo:application name="dubbo-annotation-provider"/>
dubbo.application.id = dubbo-annotation-provider
dubbo.application.name = Dubbo Provider
### <dubbo:registry id="my-registry" address="N/A"/>
dubbo.registry.id = my-registry
dubbo.registry.address = N/A
### <dubbo:protocol name="dubbo" port="12345"/>
dubbo.protocol.id = dubbo
dubbo.protocol.name = dubbo
dubbo.protocol.port = 12345
客户端配置
@EnableDubbo(basePackageClasses = TestConsumerConfiguration.class, multipleConfig = true)
@PropertySource("META-INF/dubbb-consumer.properties")
@EnableTransactionManagement
public class TestConsumerConfiguration {
}
META-INF/dubbb-consumer.properties
# Dubbo Consumer Properties as an alternative for
# Spring XML Bean definition : META-INF/spring/dubbo-annotation-consumer.xml
demo.service.application = dubbo-annotation-consumer
demo.service.registry = my-registry
## Dubbo configs binding properties
### <dubbo:application name="dubbo-annotation-consumer"/>
dubbo.application.dubbo-annotation-consumer.name = Dubbo Consumer
dubbo.application.dubbo-annotation-consumer2.name = dubbo-consumer2
### <dubbo:registry id="my-registry" address="N/A"/>
dubbo.registry.my-registry.address = N/A
dubbo.registry.my-registry2.address = N/A
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Annotation Configuration - Apache Dubbo
Annotation Configuration ; @DubboService public class AnnotationServiceImpl implements AnnotationService ; @Configuration @EnableDubbo( · = "org.apache.dubbo.
Read more >Add `EnableDubbo` annotation to dubbo · Issue #1015 - GitHub
Dubbo Provider Properties as an alternative for # Spring XML Bean definition : META-INF/spring/dubbo-annotation-provider.xml ...
Read more >Use Annotation in Apache Dubbo - DZone
Learn how to use annotation in Apache Dubbo. ... @EnableDubbo combines both @EnableDubboConfig and ... Add Configuration for the Service.
Read more >com.lizo.spring.dubbo.boot.annotation.EnableDubbo java code ...
Created by lizhou on 2017/2/28/028. */ @SpringBootApplication @ComponentScan(basePackages = "com.lizo.spring.dubbo.demo") @EnableDubbo(basePackages ...
Read more >Dubbo Spring Boot Auto-Configure - Google Git
If your project failed to resolve the dependency, try to add the following ... If you'd like to learn more , please read...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@willlau0524 本周发布
赞,希望Spring Boot相关的使用文档可以更加详细