Skip to content
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

Allow custom ChannelHandlers to control their position #2719

Closed
4 tasks
whiskeysierra opened this issue Jan 31, 2020 · 6 comments
Closed
4 tasks

Allow custom ChannelHandlers to control their position #2719

whiskeysierra opened this issue Jan 31, 2020 · 6 comments
Labels
status: pr submitted A pull request has been submitted for the issue type: improvement A minor improvement to an existing feature
Milestone

Comments

@whiskeysierra
Copy link

See zalando/logbook#629. I have a custom netty channel handler that I need to register after the http request decoder/response encoder so that I can observe the request/response as messages in my channel handler.

Plain netty supports this in their HttpServer setup like this:

HttpServer.create()
        .tcpConfiguration(tcpServer ->
                tcpServer.doOnConnection(connection ->
                        connection.addHandlerLast(new LogbookServerHandler(logbook))))

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. TODO
  2. TODO
  3. TODO

Expected Behaviour

Tell us what should happen

Actual Behaviour

Position in the channel pipeline can't be controlled.

Environment Information

  • Operating System: TODO
  • Micronaut Version: TODO
  • JDK Version: TODO

Example Application

  • TODO: link to github repository with example that reproduces the issue
@graemerocher graemerocher added the type: improvement A minor improvement to an existing feature label Jan 31, 2020
@croudet
Copy link

croudet commented Jan 31, 2020

I have an HttpServerAccessLogger class, that can help you for the moment:
https://gist.github.com/croudet/52386eb4a315fb7764b83bc12f522db5

@jameskleeh jameskleeh changed the title Allow for custom ChannelHandlers Allow custom ChannelHandlers to control their position Jan 31, 2020
@dstepanov
Copy link
Contributor

I think the best idea would be to allow to set custom handlers in HttpClientConfiguration.

@graemerocher
Copy link
Contributor

Relates to #1113

@graemerocher graemerocher added this to the 2.0.0.M3 milestone Apr 15, 2020
@graemerocher graemerocher added the status: pr submitted A pull request has been submitted for the issue label Apr 15, 2020
jameskleeh pushed a commit that referenced this issue Apr 15, 2020
 (#3061)

* Allow customization of the Netty pipeline for server/client. Fixes #2719
@graemerocher
Copy link
Contributor

Fixed in 2.x and added documentation on how to use logbook https://docs.micronaut.io/snapshot/guide/index.html#nettyPipeline

@dstepanov
Copy link
Contributor

@graemerocher Looks great!
Is it possible to have a separate customizer for server and client?

@graemerocher
Copy link
Contributor

Sure just check the isServerChannel() method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pr submitted A pull request has been submitted for the issue type: improvement A minor improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants