首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法通过RSC cli发送客户端请求

无法通过RSC cli发送客户端请求
EN

Stack Overflow用户
提问于 2020-12-27 22:57:49
回答 1查看 86关注 0票数 1

我使用一个简单的rSocket服务器来处理客户端请求。使用RSC cli发送客户端请求。

代码语言:javascript
复制
java -jar rsc.jar --debug --request --data "{\"message\":\"HiSourav\"}" --route request-response tcp://localhost:7000

上面是我用来发送请求并得到下面提到的错误的命令。

代码语言:javascript
复制
Error: Could not resolve method parameter at index 0 in reactor.core.publisher.Mono<com.example.RsocketTestWithClient.entity.Message> com.example.RsocketTestWithClient.RsocketTestWithClientApplication.requestResponse(com.example.RsocketTestWithClient.entity.Message): Failed to read HTTP message; nested exception is org.springframework.core.codec.DecodingException: JSON decoding error: Unexpected character ('m' (code 109)): was expecting double-quote to start field name; nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character ('m' (code 109)): was expecting double-quote to start field name
 at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 3]

如果你有任何建议,请告诉我。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-28 16:54:34

你的错误表明客户端有问题,

Unexpected character ('m' (code 109)): was expecting double-quote to start field name at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 3]

所以我会试着确认你发送的内容是正确的。

使用--debug (或--wiretap)输出确认客户端发送的数据是否正确。如果你已经这样做了,例如

代码语言:javascript
复制
$ rsc --request --data "{\"message\":\"HiSourav\"}" --debug tcp://localhost:9000
2020-12-28 08:52:52.158 DEBUG --- [     parallel-2] i.r.FrameLogger : sending -> 
Frame => Stream ID: 1 Type: REQUEST_RESPONSE Flags: 0b100000000 Length: 31
Metadata:

Data:
         +-------------------------------------------------+
         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
+--------+-------------------------------------------------+----------------+
|00000000| 7b 22 6d 65 73 73 61 67 65 22 3a 22 48 69 53 6f |{"message":"HiSo|
|00000010| 75 72 61 76 22 7d                               |urav"}          |
+--------+-------------------------------------------------+----------------+
2020-12-28 08:52:52.448 DEBUG --- [actor-tcp-nio-1] i.r.FrameLogger : receiving -> 
Frame => Stream ID: 1 Type: ERROR Flags: 0b0 Length: 102
Data:

Error: Destination '' does not support REQUEST_RESPONSE. Supported interaction(s): [REQUEST_STREAM]

Use --stacktrace option for details.

然后你可以确认这是一个服务器问题,你应该调试为什么服务器会在这里崩溃。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65467055

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档