使用 Protobuf(IDL) 开发 triple 通信服务
- Dominant language
- CSS
- Stars
- 491
- Forks
- 809
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 6
Description
你好,我在使用dubbo的trip协议过程中多参数遇到了问题
如果出现一个方法多个参数, `queryLearningTime(String channelCode, String crCode)` 且不是DTO形式呈现,则会出现问题
通过trip访问会报错: Name for argument of type [class java.lang.String] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the -parameters flag
这是因为trip仅是dubbo上层协议,无法做到一对一参数的映射。在jvm中,这个函数就变成了这样:
`queryLearningTime(java.lang.String, java.lang.String)`;
这样看两个都是String而且没有名字,协议无法找到序列化的参数,所以需要在maven中添加-parameters参数
```xml
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
${java.version}
${java.version}
UTF-8
-parameters
```
是否可以在 https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/tasks/protocols/triple/idl/ 页增加一些提示?
Contributor guide
No contributing guide indexed for this repository
Research direction
Open the linked Triple IDL protocol documentation page and review its existing guidance for Java services with multiple parameters. Add a note explaining the need to retain Java parameter names with the Maven compiler -parameters option, including the reported example; done when users can find this setup guidance on that page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100