Improper `Payload#hasMetadata` behavior.
See original GitHub issueI was debugging some rust codes which send a REQUEST_RESPONSE without metadata. Unexpectedly, I received a PAYLOAD frame with a metadata (blank string). ServerSide is very simple:
package com.example.rsocket;
import io.rsocket.AbstractRSocket;
import io.rsocket.Payload;
import io.rsocket.RSocketFactory;
import io.rsocket.transport.netty.server.TcpServerTransport;
import io.rsocket.util.DefaultPayload;
import java.lang.invoke.MethodHandles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
/**
* Echo
*
* @author jeffsky
* @since 2020-03-29
*/
public class Echo {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public static void main(String[] args) {
RSocketFactory.receive()
.fragment(1024)
.acceptor(
(setup, sendingSocket) ->
Mono.just(
new AbstractRSocket() {
@Override
public Mono<Payload> requestResponse(Payload payload) {
log.info(
"> data={}, meta={}, has_metadata={}",
payload.getDataUtf8(),
payload.getMetadataUtf8(),
payload.hasMetadata());
return Mono.just(payload);
}
}))
.transport(TcpServerTransport.create(7878))
.start()
.block()
.onClose()
.block();
}
}
Console show below:
20:50:42.703 [reactor-tcp-nio-2] DEBUG io.rsocket.FrameLogger - receiving ->
Frame => Stream ID: 1 Type: REQUEST_RESPONSE Flags: 0b0 Length: 15
Data:
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 65 6c 6c 6f 52 75 73 74 |HelloRust |
+--------+-------------------------------------------------+----------------+
20:50:42.705 [reactor-tcp-nio-2] INFO com.example.rsocket.Echo - > data=HelloRust, meta=, has_metadata=true
The problem I thought is that has_metadata
should be false
because the frame flags is 0b0
already.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Using Blockchain and Low Power in Smart Cities to internet of ...
this behavior, which varies according to the chosen data rate. ... The payload has metadata with the address of the API destination of....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@OlegDokuka I’ve tested it. RC-7 is OK now. Thanks! 👍
@jjeffcaii IT is fixed. Please let me know if you still experiencing this issue in RC-7-SNAPSHOT