Skip to content

[Bug] Dubbo3.3.2 ,Can not Use broadcast and Tag same time #15850

@HanlyL

Description

@HanlyL

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo 3.3.2

Steps to reproduce this issue

Start 4 service provider instances, each configured with different dubbo.provider.tag (e.g., t-01, t-02...)
Consumer uses the following Reference configuration:
@DubboReference(
interfaceClass = BpRcvMsgApi.class,
version = "1.0.0",
group = "all-t",
cluster = "broadcast"
)
private ApiTest api;
Invoke api.test() method
Exception thrown: No provider available for the service

What you expected to happen

The broadcast call should succeed and send requests to all 4 provider instances.

Anything else

TagStateRouter filters out all providers in the router chain and returns an empty list, causing the call to fail.
The issue is in org.apache.dubbo.rpc.cluster.router.tag.TagStateRouter.filterUsingStaticTag(),if tag is Null:
result = filterInvoker(
invokers, invoker -> StringUtils.isEmpty(invoker.getUrl().getParameter(TAG_KEY)));
When tagRouterRule is not configured, this method performs static tag filtering with exact string matching. Since providers have tag=t-01 and broadcast requests don't specify a tag, the matching fails and eventually returns an empty list.
Can at least one wildcard * be added?like:
result = filterInvoker(invokers, invoker ->
"*".equals(tag) || tag.equals(invoker.getUrl().getParameter(TAG_KEY))
);

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedEverything needs help from contributorstype/enhancementEverything related with code enhancement or performance

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions