Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rule有明显bug,建议扩展predicate #7

Open
qinqiang2000 opened this issue Jul 16, 2018 · 0 comments
Open

rule有明显bug,建议扩展predicate #7

qinqiang2000 opened this issue Jul 16, 2018 · 0 comments

Comments

@qinqiang2000
Copy link

qinqiang2000 commented Jul 16, 2018

底下这段代码永远只返回第一个符合条件的实例。父类的roundrobin被你忽略了。
// 优先匹配label String labelOr = metadata.get(META_DATA_KEY_LABEL_OR); if(!StringUtils.isEmpty(labelOr)){ List<String> metadataLabel = Arrays.asList(labelOr.split(CoreHeaderInterceptor.HEADER_LABEL_SPLIT)); for (String label : metadataLabel) { if(CoreHeaderInterceptor.label.get().contains(label)){ return server; } } }

核心判断建议通过扩展AbstractServerPredicate来实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant