Class MdcPropertiesInjector

java.lang.Object
io.quarkiverse.httpproblem.postprocessing.MdcPropertiesInjector
All Implemented Interfaces:
ProblemPostProcessor

public class MdcPropertiesInjector extends Object implements ProblemPostProcessor
Injects existing MDC properties listed in the configuration into final response. Missing MDC values and properties already defined in Problem instance are skipped.
  • Constructor Details

    • MdcPropertiesInjector

      @Inject public MdcPropertiesInjector(ProblemRuntimeFixedConfig config)
    • MdcPropertiesInjector

      public MdcPropertiesInjector(Set<String> properties)
  • Method Details

    • priority

      public int priority()
      Description copied from interface: ProblemPostProcessor
      Defines order in which processors are triggered. Bigger value means precedence before processors with lower priority. When two processors have the same priority then order of invocation is undefined.
      Specified by:
      priority in interface ProblemPostProcessor
    • apply

      public HttpProblem apply(HttpProblem problem, ProblemContext context)
      Description copied from interface: ProblemPostProcessor
      Interceptor method for HttpProblems. In case problem should be changed or enhanced, one can use 'HttpProblem.builder(httpProblem)'.

      Implementations should be thread-safe.

      Specified by:
      apply in interface ProblemPostProcessor
      Parameters:
      problem - Original HttpProblem, possibly processed by other processors with higher priority.
      context - Additional, internal metadata not included in HttpProblem
      Returns:
      Can be original HttpProblem (for peek-type processors), changed copy or completely new HttpProblem (for map-type processors.