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

Micronaut configuration #629

Closed
marceloverdijk opened this issue Nov 4, 2019 · 15 comments
Closed

Micronaut configuration #629

marceloverdijk opened this issue Nov 4, 2019 · 15 comments
Labels
Milestone

Comments

@marceloverdijk
Copy link

Would you consider adding a logbook-micronaut-configuration module similar as logbook-spring-boot-starter? Or accepting a PR for this?

@marceloverdijk
Copy link
Author

Probably not that easy as the http logging is tight to the servlet api, which Micronaut is not using.
It is similar as #331.

@whiskeysierra
Copy link
Collaborator

whiskeysierra commented Nov 4, 2019 via email

@marceloverdijk
Copy link
Author

@whiskeysierra Under the hood yes, but not directly. But exposed in the framework they have their own classes like Micronaut's HttpRequest similar as Spring WebFlux has ServerRequest That's why I made the second comment that it might not be that easy.

@whiskeysierra
Copy link
Collaborator

If we could build a module for Netty than that could cover #331 as well

@whiskeysierra whiskeysierra added this to the 3.0.0 milestone Jan 23, 2020
@whiskeysierra
Copy link
Collaborator

@marceloverdijk Do you happen to have experience with micronaut in terms of a customized netty setup by any chance?

@marceloverdijk
Copy link
Author

@whiskeysierra unfortunately not, maybe good to reach out to @graemerocher or discuss it on https://gitter.im/micronautfw/questions

@graemerocher
Copy link

What is it you want to achieve?

@whiskeysierra
Copy link
Collaborator

I want to register a custom ChannelHandler which does http-specific traffic logging.

@graemerocher
Copy link

Seems currently we only allow injection of instances of ChannelOutboundHandler if your instance is a ChannelOutboundHandler then you can do:

@javax.inject.Singleton
class MyHandler implements ChannelOutboundHandler {
  // your impl
}

And it will be registered automatically

@whiskeysierra
Copy link
Collaborator

@graemerocher Can I control the position within the pipeline?

@graemerocher
Copy link

You can implemented Ordered but that doesn't seem to provide full control at the moment. Where does it need to go in the pipeline?

@whiskeysierra
Copy link
Collaborator

After the http codec. I need to observe Netty's HttpRequest and HttpResponse objects as messages in my handler.

@graemerocher
Copy link

Seems like we need a better API for that. Can you report an issue https://github.com/micronaut-projects/micronaut-core/issues

@whiskeysierra
Copy link
Collaborator

#708 introduces support for Netty. Now it's up to Micronaut users to lobby for the change on Micronaut side to get the ability to register those handlers into Micronaut itself: micronaut-projects/micronaut-core#2719

@dstepanov
Copy link

@whiskeysierra Is there a way to try netty support for logbook? 'https://oss.sonatype.org/content/repositories/snapshots' and 2.1.0-SNAPSHOT doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants