-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot update netty pipeline with outbound channel handlers #543
Comments
Yeah, by and large, Aleph uses Netty, but doesn't support you using Netty very well. There may have been good reasons for this (like the ref-counting management required when using your own channel handlers), but I'm not privy to Zach's mind. The general expectation is the main handler you supply takes care of everything. It would be nice to better support channel handlers, though, so if you want to make a PR for UDP and TCP that adds a |
Starting to work on this. |
Any update on this, out of curiosity? |
It's a small change but I had a hard time writing integration tests around GRPC. |
@arnaudgeiser is there a branch I could take a look at? |
I mentioned this issue in Clojurians slack here. |
I don't have much but the following branch : https://github.com/clj-commons/aleph/compare/protobuf?expand=1 |
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.
The text was updated successfully, but these errors were encountered: