Class TraceparentFilterFunction

java.lang.Object
com.wultra.core.rest.client.base.TraceparentFilterFunction
All Implemented Interfaces:
org.springframework.web.reactive.function.client.ExchangeFilterFunction

public class TraceparentFilterFunction extends Object implements org.springframework.web.reactive.function.client.ExchangeFilterFunction
An ExchangeFilterFunction for adding traceparent header to WebClient requests. It also propagates trace ID through Reactor context and MDC for logging purposes.
Author:
Jan Dusil, jan.dusil@wultra.com
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<org.springframework.web.reactive.function.client.ClientResponse>
    filter(org.springframework.web.reactive.function.client.ClientRequest request, org.springframework.web.reactive.function.client.ExchangeFunction next)
    Applies the filter to the given ClientRequest and ExchangeFunction.
    static org.springframework.web.reactive.function.client.ExchangeFilterFunction
    Factory method to create an instance of TraceparentFilterFunction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.reactive.function.client.ExchangeFilterFunction

    andThen, apply
  • Constructor Details

    • TraceparentFilterFunction

      public TraceparentFilterFunction()
  • Method Details

    • filter

      public reactor.core.publisher.Mono<org.springframework.web.reactive.function.client.ClientResponse> filter(org.springframework.web.reactive.function.client.ClientRequest request, org.springframework.web.reactive.function.client.ExchangeFunction next)
      Applies the filter to the given ClientRequest and ExchangeFunction.
      Specified by:
      filter in interface org.springframework.web.reactive.function.client.ExchangeFilterFunction
      Parameters:
      request - The client request.
      next - The next exchange function in the chain.
      Returns:
      a Mono after applying the filter.
    • handleTraceparentContext

      public static org.springframework.web.reactive.function.client.ExchangeFilterFunction handleTraceparentContext()
      Factory method to create an instance of TraceparentFilterFunction.
      Returns:
      a new instance of TraceparentFilterFunction.