Class RequestContextHooks

java.lang.Object
com.linecorp.armeria.common.reactor3.RequestContextHooks

public final class RequestContextHooks extends Object
Utility class to keep RequestContext during Reactor operations.
  • Method Details

    • enable

      public static void enable()
      Enables RequestContext during Reactor operations. The reactor Publishers such as Mono and Flux will have the RequestContext which is in the RequestContextStorage when the Publishers are created. Then, the RequestContext is propagated during the operations so that you can get the context using RequestContext.current().

      However, please note that Mono.doOnCancel(Runnable), Mono.doFinally(Consumer), Flux.doOnCancel(Runnable) and Flux.doFinally(Consumer) will not propagate the context.

      Also, note that this method does not have any relevance to Reactor's own Context API.

    • disable

      public static void disable()
      Disables RequestContext during Reactor operations.