You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/06/28 03:28:35 UTC
[GitHub] AnthonyZero removed a comment on issue #825: @DubboComponentScan注解在消费端扫描包时扫描的是 @Service注解??不是@Reference注解??
AnthonyZero removed a comment on issue #825: @DubboComponentScan注解在消费端扫描包时扫描的是 @Service注解??不是@Reference注解??
URL: https://github.com/apache/incubator-dubbo/issues/825#issuecomment-400899114
在最新2.6.2版本中 @Reference字段所在的类扫描并装配了的,但是并没有使用@DubboComponentScan处理 @Reference字段也能消费成功。 这是为什么呢
`@RestController
public class DemoConsumerController {
@Reference(version = "${demo.service.version}",
application = "${dubbo.application.id}"
/*url = "dubbo://localhost:12345"*/)
private DemoService demoService;
@RequestMapping("/sayHello")
public String sayHello(@RequestParam String name) {
return demoService.sayHello(name);
}
}`
`@SpringBootApplication
@ComponentScan("com.alibaba.boot.dubbo.demo.consumer.controller")
public class DubboConsumerDemo{
public static void main(String[] args) {
SpringApplication.run(DubboConsumerDemo.class,args);
}
}`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org