tapir icon indicating copy to clipboard operation
tapir copied to clipboard

Extend netty configuration

Open adamw opened this issue 2 years ago • 2 comments

Currently configuration of Netty-based interpreters is split into two parts:

  • NettyConfig, which configures the Netty server itself - the pipeline, networking etc.
  • NettyFutureServerOptions, which configures the Netty server interpreter

The goal of this task is to extend the configuration with some useful options known from other servers. This should mostly influence NettyConfig, but it's also possible that NettyXServerOptions will have to be made dependent on NettyConfig.

Options to add (roughly following https://doc.akka.io/docs/akka-http/current/configuration.html):

  • [ ] default Server: header (if none is specified explicitly)
  • [x] idle timeout
  • [x] request timeout
  • [x] bind timeout
  • [x] linger timeout (if applicable to netty?)
  • [x] max connections
  • [x] backlog (maybe this is already implemented as socketBacklog?)
  • [x] socket options
  • [x] max content length: this should be configurable globally, and per-endpoint. The implementations might be unrelated, and the per-endpoint should probably use an attribute + an interceptor

Config options can be grouped into sub-config-objects if necessary. This should probably be split into a couple of PRs.

adamw avatar Jun 16 '23 12:06 adamw

There is no option in the default Netty configuration to set the max-connections and max-content-length options. Additionally, I'm not certain about the default header. There is also no option available in the default Netty configuration, but shouldn't it be handled at the Tapir level?

wydra98 avatar Jun 30 '23 09:06 wydra98

If these are not already implemented as a Netty option, we have to implement them ourselves :)

adamw avatar Jul 06 '23 13:07 adamw