Closed xmsz closed 2 years ago
如果通过RPCService调用
resp, err := config.GetRPCService(ProviderImplName).(*config.GenericService).Invoke(
context.TODO(),
[]interface{}{
"GetOfficialNumRank",
[]string{ProviderImplName},
[]interface{}{accountId},
},
)
则出现
panic: reflect: call of reflect.Value.Call on zero Value
goroutine 20 [running]:
reflect.flag.mustBe(...)
/usr/local/go/src/reflect/value.go:221
reflect.Value.Call(0x0, 0x0, 0x0, 0xc0000bd6f8, 0x1, 0x10, 0x0, 0x0, 0xc000340be8)
/usr/local/go/src/reflect/value.go:335 +0x174
github.com/dubbogo/triple/pkg/triple.getInvoker(0x49bf980, 0xc0001a88e8, 0xc000144050, 0x0, 0x4a05e00)
/go/pkg/mod/github.com/dubbogo/triple@v1.0.2/pkg/triple/dubbo3_conn.go:61 +0x1ba
github.com/dubbogo/triple/pkg/triple.NewTripleClient(0x49bf980, 0xc0001a88e8, 0xc000164180, 0xc000164180, 0xc00000e438, 0x0)
/go/pkg/mod/github.com/dubbogo/triple@v1.0.2/pkg/triple/dubbo3_client.go:72 +0x211
dubbo.apache.org/dubbo-go/v3/protocol/dubbo3.NewDubboInvoker(0xc000160180, 0x4a04401, 0x4b59290, 0x5226cf0)
...
你可以参照这个测试用例试试https://github.com/apache/dubbo-go/blob/3.0/config/reference_config_test.go
有没有简单一点的DEMO,因为刚学有点想先实现看看效果。普通调用没问题就是泛化没有完整DEMO不知道怎么跑,现在DEMO里的我跑不起来
现在遇到
panic: Failed to invoke the method $invoke. No provider available for the service dubbo://:@192.168.1.83:80/?interface=org.apache.dubbo.RankProvider&group=&version= from registry nacos://127.0.0.1:8848?group=®istry=nacos®istry.label=true®istry.preferred=false®istry.role=0®istry.timeout=®istry.ttl=®istry.weight=0®istry.zone=&simplified=false on the consumer 192.168.1.83 using the dubbo version 3.0.0 .Please check if the providers have been started and registered.
然后我尝试设置一个url config.URL = "dubbo://127.0.0.1:8848"
调试信息变多了,但是还是没有执行方法
2021-08-11T10:46:49.471+0800 ERROR dubbo/dubbo_codec.go:244 pkg.Unmarshal(len(@data):0) = error:illegal package!
github.com/apache/dubbo-go-hessian2.init
getty/readwriter.go:60 pkg.Unmarshal(ss:&{name:client endPoint:0xc00021d4a0 Connection:0xc000219450 listener:0xc00020d390 reader:0xc0002082b0 writer:0xc0002082b0 maxMsgLen:102400 period:30000000000 wait:1000000000 once:0xc000212700 done:0xc000382300 attrs:0xc00020d380 grNum:2 rDone:0xc000382360 lock:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0}}, len(@data):590) = error:illegal package!
github.com/apache/dubbo-go-hessian2.init
maybe the client read timeout or fail to decode tcp stream in Writer.Write
我尝试补充dubbo-go-sample的实例
我尝试补充dubbo-go-sample的实例
感恩!
建议优先考虑使用配置文件的形式进行启动
建议优先考虑使用配置文件的形式进行启动
ok 然后我用配置试了一下
result err: Failed to invoke the method $invoke. No provider available for the service dubbo://:@192.168.1.83:80/?interface=org.apache.dubbo.RankProvider&group=&version= from registry nacos://127.0.0.1:8848?group=®istry=nacos®istry.label=true®istry.preferred=false®istry.role=0®istry.timeout=3s®istry.ttl=10m®istry.weight=0®istry.zone=&simplified=false on the consumer 192.168.1.83 using the dubbo version 1.5.6 .Please check if the providers have been started and registered.
为什么会有@192.168.1.83:80/
这个我要哪里设置
原因是没有先启动相关的provider实例,可在对应的reference配置加check: false
references:
"UserProvider":
registry: "demoZk"
protocol : "dubbo"
interface : "org.apache.dubbo.UserProvider"
cluster: "failover"
check: false
methods :
- name: "GetUser"
retries: 3
我好像找到我大部分问题的所在了
我用的是dubbo3,但是我的samples的分支一直是master(2.0)。导致服务一直对不上
我再试一试
我好像找到我大部分问题的所在了
我用的是dubbo3,但是我的samples的分支一直是master(2.0)。导致服务一直对不上
我再试一试
import (
"context"
"time"
"dubbo.apache.org/dubbo-go/v3/config"
gxlog "github.com/dubbogo/gost/log"
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
_ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/nacos"
)
@ChangedenCZD 不好意思 我可能还是需要一个DEMO
dubbo-go3 + tri + protobuf + nacos +泛化
我现在还是没跑通
3.0 Sample里的generic DEMO,我本地能跑通,但是一改就崩 太难受了
@xavier-niu Pls follow up on this issue.
@xmsz You can join our dingtalk group:23331795 and discuss the problem together. I found a problem that, pb serialization service can't be generic invoked. I'm not sure which serialization type you choose in your server side.
@ChangedenCZD 不好意思 我可能还是需要一个DEMO
dubbo-go3 + tri + protobuf + nacos +泛化
我现在还是没跑通
3.0 Sample里的generic DEMO,我本地能跑通,但是一改就崩 太难受了
补充了demo,您可以去protobuf-and-nacos-sample-pr或protobuf-and-nacos-sample-code拉取相关代码,看看是否能解决您部分疑惑。
@xmsz Any feedback?
@xmsz Any feedback?
最近没时间测了 我过段时间再反馈
出现错误