Comments (12)
DubboProperties里面是一些provider和consumer的公共配置,其它配置可在注解@service(provider端)和@reference(consumer端)里面配置。
from dubbo-spring-boot-starter.
Is the @Service
annotation's filter property is actually used? I looked at the source code for dubbo and it doesn't seem to use it. Were you able to get this to work?
from dubbo-spring-boot-starter.
@adriancole hi, @service annotation's filter property is inited in com.alibaba.dubbo.config.AbstractConfig#appendAnnotation, line 435. It works already in dubbo 2.6.0.
from dubbo-spring-boot-starter.
thanks. please ignore me on this one. I think I have a misunderstanding about how filter lifecycle works. I have found manually that a setter in trace filter was never called https://github.com/openzipkin/sleuth-webmvc-example/compare/add-dubbo-tracing
from dubbo-spring-boot-starter.
I guess I'd like to externalize the filter config as opposed to hard-code it on the annotation
@chickenlj mentioned to me this:
XML looks like this:
<!-- default timeout and filter for all services -->
<dubbo:consumer timeout="5000" filter="tracing" />
And annotation or spring boot, use .properties instead, for example:
dubbo.consumer.filter="tracing"
I tried in spring boot's properties file, even in a separate dubbo.properties file. Seems like filter should be something that we can do in spring boot style somehow (change without require user's code to change), ex via spring boot properties or autoconfiguration..
from dubbo-spring-boot-starter.
sorry forgot to mention above was @chickenlj
from dubbo-spring-boot-starter.
PS please hold an hour I was using a stale version of spring-cloud-sleuth.
We had to change sleuth as dubbo requires the bean name to exact match the extension name, so we changed sleuth to make sure it is exactly the same. I will update instructions on my end, and summarize progress in an hour.
from dubbo-spring-boot-starter.
ok so right now, as far as I can tell, there is no way to use spring boot (application.properties or autoconfig) to assign a global filter. The only way is external to spring boot, ex via a dubbo.properties file
dubbo.provider.filter=tracing
dubbo.consumer.filter=tracing
This works, but the problem is that in spring boot you will not see this and it won't be intuitive. For example if I hit the /autoconfig endpoint it will not know about this properties file.
It would be nice to be able to define a bean like this:
@GlobalFilter @Bean Filter tracing(Tracing tracing) {
TracingFilter result = new TracingFilter();
result.setTracing(tracing);
return tracing;
}
and have the above as the same as if it were set by properties "dubbo.provider.filter=tracing" and "dubbo.consumer.filter=tracing". However, I noticed that the extension loader for filter happens before hand because the filter itself is registered in meta-inf. In other words the statically initialized filter works instead.
For this reason, the simplest way out could just be allowing the spring boot starter here to define
spring.dubbo.provider.filter=tracing
spring.dubbo.consumer.filter=tracing
As long as spring is at least in control of the property names, we should be able to automatically insert the word tracing with spring-cloud-sleuth.
Does this make sense?
from dubbo-spring-boot-starter.
@adriancole Please switch to this starter : https://github.com/dubbo/dubbo-spring-boot-project , which is official starter, thanks!
from dubbo-spring-boot-starter.
@mercyblits I have been told both are official, but I suppose dubbo is the more official one now (due to apache I guess?)
from dubbo-spring-boot-starter.
@adriancole yes, https://github.com/dubbo/dubbo-spring-boot-project is more better :D
from dubbo-spring-boot-starter.
Duplicate of #72
from dubbo-spring-boot-starter.
Related Issues (20)
- What is the relationship between this project and the incubator-dubbo-spring-boot-project HOT 1
- 请问DubboServer的作用是什么? HOT 1
- 请问,如何添加filter HOT 1
- 还要加@component,建议封装好,只需@Service就好了
- 能不能把这个项目给关掉啊 HOT 2
- provider loadbalance 去哪儿了,还是换了名称
- 请问这个starter还需不需要加zookeeper的jar了?不加会报错,加了还是报错。亦或是我yml配置错误? HOT 1
- 这个starter和apache/incubator里的那个starter是什么关系
- 2.0版本,No such application config! Please add <dubbo:application name="..." /> to your spring config. HOT 1
- @Reference 内没找到protocol字段,如何指定协议?
- DubboConsumerAutoConfiguration创建ClassIdBean字段有不正确
- DubboConsumerAutoConfiguration在解析Reference时有Bug,比如@Reference(interfaceName = "QueryAvaliableBalance",generic = true,check = false )
- 2.0.0版本如何关闭qos
- Avoid use of Javadoc tag for configuration key descriptions
- Spring Boot 2 official support
- 此版本的dubbo快速启动项目支持配置多个注册中心么 HOT 1
- build出错,貌似dubbo2.6.2类ProtocolConfig中已经不提供destroyAll()方法了 HOT 1
- dubbo2.5.3
- 消费者设置lazy=true时不生效
- spring.dubbo.protocol.port 修改本地监听端口不生效, 使用spring.dubbo.provider.port这个才生效了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo-spring-boot-starter.