api7 / mod_dubbo

Dubbo module for Nginx
BSD 2-Clause "Simplified" License
6 stars 5 forks source link

service_version参数不可用 #9

Closed MichelLiu closed 2 years ago

MichelLiu commented 3 years ago

使用service_version注册routes后,不能正常调用dubbo服务

POST http://localhost:9080/apisix/admin/routes/2 { "uris": [ "/okks1" ], "plugins": { "dubbo-proxy": { "service_name": "com.koios.rpc.service.TaskService", "service_version": "1.0.0", "method": "tengineDubbo" } }, "upstream_id": 2 }

报错信息如下:

com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.koios.rpc.service.TaskService:20880 in [com.koios.rpc.service.TaskService:1.0.0:20880, default/com.koios.rpc.service.AppConfigService:1.0.0:20880], may be version or group mismatch , channel: consumer: /10.253.9.12:35772 --> provider: /10.253.9.120:20880, message:RpcInvocation [methodName=tengineDubbo, parameterTypes=[interface java.util.Map], arguments=[{content-length=63, x-forwarded-proto=http, postman-token=721ef882-7734-4042-9e88-9a267abf7df6, x-forwarded-port=80, x-forwarded-for=172.19.15.75, 10.12.112.46, body=[B@231be3a6, accept=/, x-real-ip=10.12.112.46, x-forwarded-server=traefik-ingress-controller-j7qhn, x-forwarded-host=apisix.k8s1.dev.internal.mimi.cn:80, globalticket=14641-1621835005.645-172.19.15.75-349-399193624, x-api-key=xxxxxxxxxxxxxxxxxx, host=apisix.k8s1.dev.internal.mimi.cn:80, content-type=application/json, cache-control=no-cache, accept-encoding=gzip, deflate, br, user-agent=PostmanRuntime/7.26.8}], attachments={path=com.koios.rpc.service.TaskService, input=734, dubbo=2.0.2, version=0.0.0}] ./7.26.8}], attachments={path=com.koios.rpc.service.TaskService, input=734, dubbo=2.0.2, version=0.0.0}] at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:205) at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:76) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96) at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:168) at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:50) at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:79) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

java服务dubbo配置:

<dubbo:service ref="taskService" interface="com.koios.rpc.service.TaskService" version="1.0.0"/>

如果不使用version则可以正常调用:

<dubbo:service ref="taskService" interface="com.koios.rpc.service.TaskService"/>