Interface ExchangeFilterFunction

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ExchangeFilterFunction
    Represents a function that filters an exchange function.

    The filter is executed when a Subscriber subscribes to the Publisher returned by the WebClient.

    Since:
    5.0
    Author:
    Arjen Poutsma
    • Method Detail

      • filter

        reactor.core.publisher.Mono<ClientResponsefilter​(ClientRequest request,
                                                           ExchangeFunction next)
        Apply this filter to the given request and exchange function.

        The given ExchangeFunction represents the next entity in the chain, to be invoked via invoked in order to proceed with the exchange, or not invoked to shortcut the chain.

        Parameters:
        request - the current request
        next - the next exchange function in the chain
        Returns:
        the filtered response
      • andThen

        default ExchangeFilterFunction andThen​(ExchangeFilterFunction afterFilter)
        Return a composed filter function that first applies this filter, and then applies the given "after" filter.
        Parameters:
        afterFilter - the filter to apply after this filter
        Returns:
        the composed filter