rsocket / rsocket-java

Java implementation of RSocket
http://rsocket.io
Apache License 2.0
2.35k stars 354 forks source link

#1077 type safe discard element consumer #1079

Closed luczus closed 1 year ago

luczus commented 1 year ago

Discard element consumer is accepting other elements than ReferenceCounted

Motivation:

When I use DefaultRSocketClient in logs files I see warning log entries like:

] WARN  reactor.core.publisher.Operators        : Error in discard hook
java.lang.ClassCastException: class org.springframework.core.io.buffer.NettyDataBuffer cannot be cast to class io.netty.util.ReferenceCounted (org.springframework.core.io.buffer.NettyDataBuffer and io.netty.util.ReferenceCounted are in unnamed module of loader 'app')

Modifications:

Make discard consumer accept other types than ReferenceCounted parameter and avoid having warnings in logs

Result:

The warning log entries are not created by DefaultRSocketClient.

kmccarp commented 1 year ago

Is there any plan to integrate this? This is heavily polluting our logs.

OlegDokuka commented 1 year ago

close in favor of #1091