AsperforMias opened a new issue, #3803:
URL: https://github.com/apache/dubbo-go/issues/3803
### 现象
在 develop(6b04ac04)上,dubbo-go-samples 里 `generic/go-server` 的 `UserProvider`
可以正常导出和调用,但在 Dubbo Admin 的服务搜索、详情和方法列表里都看不到它。
### 原因
`User` 里有一个 `time.Time` 字段。生成 ServiceDefinition 时,反射构建器报错 `time.Time is not
supported: no JSON wire representation is defined for time.Time yet`,于是跳过所有用到
`User` 的方法。`Invoke` 的参数是 `interface {}`,也被跳过了。最后这个服务一个可发布的方法都没剩下。跳过本来是按方法进行的,但
`time.Time` 太常见,一个字段就足以让整个服务在 Admin 里消失。
### 复现
1. 启动 Nacos 2.5.2。
2. 用 develop 运行 `generic/go-server` 的 provider,注册到 Nacos。
3. 在日志里搜 `[Metadata][Definition]`,能看到上面的报错。
4. 请求 Admin 的 `GET /api/v1/service/search?keywords=&mesh=<nacos
mesh>`,返回结果里没有 `UserProvider`。
作为对照,去掉 `time.Time` 字段后的同类服务能正常发布,在 Admin 里能看到,泛化调用也能成功。
### 建议
给 `time.Time` 加上类型映射,Java 侧对应的是
`java.util.Date`。或者在部分方法被跳过时,照样发布其余的方法和类型,不让整个服务消失。
--
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]