[Bug] Dubbo3.3.2 ,Can not Use broadcast and Tag same time
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
### Pre-check
- [x] I am sure that all the content I provide is in English.
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) 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?
- [x] Yes I am willing to submit a pull request on my own!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Contributor guide
Research direction
Start in org.apache.dubbo.rpc.cluster.router.tag.TagStateRouter, specifically filterUsingStaticTag(), and reproduce the issue with four differently tagged providers and a broadcast reference. Done means the broadcast call reaches all providers instead of returning no provider available, while normal tag-based routing continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100