Aetherance opened a new issue, #3199:
URL: https://github.com/apache/dubbo-go/issues/3199

   ### ✅ 验证清单
   
   - [x] 🔍 我已经搜索过 [现有 
Issues](https://github.com/apache/dubbo-go/issues),确信这不是重复问题
   
   ### 🚀 Go 版本
   
   1.25.5
   
   ### 📦 Dubbo-go 版本
   
   v3.3.1
   
   ### 🖥️ 服务端配置
   
   _No response_
   
   ### 💻 客户端配置
   
   _No response_
   
   ### 🌐 协议配置
   
   triple
   
   ### 📋 注册中心配置
   
   zookeeper v3.9.0
   
   ### 💾 操作系统
   
   🐧 Linux
   
   ### 📝 Bug 描述
   
   在 dubbo-go v3 NewInstance API 模式下,TagRouter 失效。即便设置了 
force.tag=true,请求仍会绕过路由逻辑发送到不匹配的实例。
   
   ### 🔄 重现步骤
   
   server:
   ```go
   func main() {
        ins, _ := dubbo.NewInstance(
                dubbo.WithName("reproduce-server"),
                dubbo.WithRegistry(registry.WithZookeeper(), 
registry.WithAddress("127.0.0.1:2181")),
        )
        srv, _ := 
ins.NewServer(server.WithServerProtocol(protocol.WithTriple(), 
protocol.WithPort(20001)))
        greet.RegisterGreetServiceHandler(srv, &GreetServiceHandler{})
        srv.Serve()
   }
   ```
   
   client:
   ```go
   func main() {
        ins, _ := dubbo.NewInstance(
                dubbo.WithRegistry(registry.WithZookeeper(), 
registry.WithAddress("127.0.0.1:2181")),
        )
        cli, _ := ins.NewClient()
        svc, _ := greet.NewGreetService(cli)
   
        time.Sleep(10 * time.Second) // wait for discovery
   
        ctx := context.WithValue(context.Background(), constant.AttachmentKey, 
map[string]string{
                "dubbo.tag":       "not-exist-tag",
                "dubbo.force.tag": "true",
        })
   
        resp, err := svc.Greet(ctx, &greet.GreetRequest{Name: "Dubbo"})
        fmt.Printf("Response: %v\nError: %v\n", resp, err)
   }
   ```
   
   ### ✅ 预期行为
   
   在设置 `"dubbo.force.tag": "true"` 时,dubbo-go 应该遵守路由规则。如果没有能够满足路由规则的节点,rpc 
调用应该返回 error No provider available for the service。Response 应为 nil,且本次 rpc 调用失败
   
   ### ❌ 实际行为
   
   实际输出:
   ```
   Requesting with tag: not-exist-tag, force: true
   Response: greeting:"Hello Dubbo, (Port: 20001, StaticTag: no-tag)"
   Error: <nil>
   ```
   
   ### 💡 可能的解决方案
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to