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

标签路由问题 #7519

Closed
houwen0 opened this issue Apr 8, 2021 · 5 comments
Closed

标签路由问题 #7519

houwen0 opened this issue Apr 8, 2021 · 5 comments
Labels
help wanted Everything needs help from contributors

Comments

@houwen0
Copy link

houwen0 commented Apr 8, 2021

java -jar xxx-provider.jar -Ddubbo.provider.tag={the tag you want, may come from OS ENV}

请问我用的2.7.8版本测试,没有生效?

@AlbumenJ AlbumenJ added the help wanted Everything needs help from contributors label Apr 9, 2021
@gentryhuang
Copy link

检查是否同时使用了动态打标方式,动态打标优先级更高。

@BigBlackSheep
Copy link

customer 如何调用的?

@CrazyHZM
Copy link
Member

If you haven’t received feedback for a long time, close the issues first, and reopen it if you have any problems.

@wuwen5
Copy link
Contributor

wuwen5 commented Dec 30, 2021

#9512

@wuwen5
Copy link
Contributor

wuwen5 commented Jan 18, 2022

@AlbumenJ @CrazyHZM 这个问题简单验证了一下,的确是不生效啊。

TagRouter

private <T> List<Invoker<T>> filterUsingStaticTag(List<Invoker<T>> invokers, URL url, Invocation invocation) {
        List<Invoker<T>> result;
        // Dynamic param
        String tag = StringUtils.isEmpty(invocation.getAttachment(TAG_KEY)) ? url.getParameter(TAG_KEY) :
                invocation.getAttachment(TAG_KEY);
        // Tag request
        if (!StringUtils.isEmpty(tag)) {
            // invoker.getUrl().getParameter(TAG_KEY)这里拿不到值的,详见#9512
            result = filterInvoker(invokers, invoker -> tag.equals(invoker.getUrl().getParameter(TAG_KEY)));
            if (CollectionUtils.isEmpty(result) && !isForceUseTag(invocation)) {
                result = filterInvoker(invokers, invoker -> StringUtils.isEmpty(invoker.getUrl().getParameter(TAG_KEY)));
            }
        } else {
            result = filterInvoker(invokers, invoker -> StringUtils.isEmpty(invoker.getUrl().getParameter(TAG_KEY)));
        }
        return result;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Everything needs help from contributors
Projects
None yet
Development

No branches or pull requests

7 participants
@wuwen5 @AlbumenJ @BigBlackSheep @houwen0 @CrazyHZM @gentryhuang and others