apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.39k stars 26.41k forks source link

the way to get dubbo interface proxy object from spring context? #1035

Closed Comven closed 6 years ago

Comven commented 6 years ago

When the @Reference annotation is used, is there a way to get it from the spring context, such as ApplicationContext.getBean ("Dubbo interface name")? I printed the details of ApplicationContext, and I couldn't find the bean injected by @Reference. Is there a way to achieve it

Comven commented 6 years ago

by the way, when I configiured it by with xml,it works fine.

mercyblitz commented 6 years ago

@Reference works for setter injection , like @Autowired.

If application invoked <dubbo:reference> under XMl-based configuration , the ReferenceBean bean will be present in ApplicationContext.

Comven commented 6 years ago

@mercyblitz But I don't want to use XML to configure it because we use springboot, Is there any other way to do it?perhaps the newest dubbo-spring-boot-starter will support it?

mercyblitz commented 6 years ago

@Comven It will be add into endpoint on spring boot starter , please refer here : https://github.com/dubbo/dubbo-spring-boot-project/milestone/1