Skip to content

Commit

Permalink
Retain metadata for Flux payloads
Browse files Browse the repository at this point in the history
to avoid io.netty.util.IllegalReferenceCountException
  • Loading branch information
making committed Sep 23, 2020
1 parent 8b45732 commit 50d0c3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/am/ik/rsocket/InteractionModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static Flux<Payload> payloadFlux(Args args) {
return scanToFlux(scanner) //
.transform(s -> args.log().map(__ -> s.log("input")).orElse(s)) //
.map(x -> DefaultPayload.create(Unpooled.wrappedBuffer(x.getBytes(UTF_8)),
args.composeMetadata().getT2()))
args.composeMetadata().getT2().retain()))
.doOnTerminate(scanner::close);
} else {
return Flux.just(DefaultPayload.create(args.data(), args.composeMetadata().getT2()));
Expand Down

0 comments on commit 50d0c3d

Please sign in to comment.