Interface ServerFeatureProvider<T extends ServerFeature>

Type Parameters:
T - type of the server feature the provider provides
All Superinterfaces:
ConfiguredProvider<T>
All Known Implementing Classes:
AccessLogFeatureProvider, ContextFeatureProvider, CorsFeatureProvider, LimitsFeatureProvider, ObserveFeatureProvider, OpenApiFeatureProvider, SecurityFeatureProvider

public interface ServerFeatureProvider<T extends ServerFeature> extends ConfiguredProvider<T>
Server features provider is a ServiceLoader provider API to discover server wide features.

When creating a custom feature, one of the aspects important for how it is configured with the server, and with routing, is the Weight.

There are three places where weight is taken into account:

  1. When discovering server features from the service loader, the weight of this provider implementation is used
  2. When setting up server features within the server (and as a default for HttpFeature added by a server feature), the Weight or Weighted of the ServerFeature implementation is used to order the features
  3. When configuring HttpFeature from a server feature, the weight of that implementation can override the default from the server feature, and the weight is used to order all HTTP features, including user routing (which has the default weight of 100.0)
The following weights are used by features of Helidon:
  • Context: 1100
  • Access Log: 1000
  • Tracing: 900
  • CORS: 950
  • Security: 800
  • User routing (all handlers): 100
  • OpenAPI: 90
  • Observe (metrics, health, etc.): 80
For some features the weight can be modified using configuration, key is always weight.