Description
Currently transforming the netty pipeline with outbound channel handlers on a TCP server does not work. Aleph expects that you only put onto the stream something that can be converted to a ByteBuf by aleph.netty/to-byte-buf
.
For incoming channel handlers you can change this behavior by setting :raw-stream? true
, however that does not change the behavior on outbound channel handlers. See https://github.com/ztellman/aleph/blob/master/src/aleph/tcp.clj#L47.
Probably this same problem exists for TCP clients.
The use case is adding frame splitters/creators for Protobuf messages (https://netty.io/4.1/api/io/netty/handler/codec/protobuf/ProtobufDecoder.html) which is implemented as netty encoders/decoders. In the TCP handler you would receive a decoded Protobuf message and you have to return a Protobuf message, not a coercable-to-ByteBuf.