我使用一个简单的rSocket服务器来处理客户端请求。使用RSC cli发送客户端请求。
java -jar rsc.jar --debug --request --data "{\"message\":\"HiSourav\"}" --route request-response tcp://localhost:7000上面是我用来发送请求并得到下面提到的错误的命令。
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]如果你有任何建议,请告诉我。
发布于 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)输出确认客户端发送的数据是否正确。如果你已经这样做了,例如
$ 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.然后你可以确认这是一个服务器问题,你应该调试为什么服务器会在这里崩溃。
https://stackoverflow.com/questions/65467055
复制相似问题