title: Get Reactor Subscriber Context in doOnSubscribe, doOnSuccess and doOnError
body: <p>I'm trying to implement the Reactor Subscriber Context (<a href="http://projectreactor.io/docs/core/release/reference/#context" rel="nofollow noreferrer">http://projectreactor.io/docs/core/release/reference/#context</a>) so I can pass values from my SLF4J MDC into a Flux where I then can use the values for logging.</p>
  
  <p>I use the subscriberContext() method to set the value like:</p>
  
  <pre><code>someFlux().subscriberContext(Context.of(MDC_ATTRIBUTE, MDC.get(MDC_ATTRIBUTE)));
  </code></pre>
  
  <p>I also can access the context in the chain. For example with a flatMap:</p>
  
  <pre><code>.flatMap(r -&gt; Mono.subscriberContext().map(ctx -&gt; {
      String name = ctx.getOrDefault(MDC_ATTRIBUTE_NAME, "NO CTX");
      return r;
  }))
  </code></pre>
  
  <p>Also <code>doOnEach()</code> works:</p>
  
  <pre><code>.doOnEach(signal -&gt; {
      Context ctx = signal.getContext();
      if (signal.isOnNext()) {
          try (MDC.MDCCloseable closeable = MDC.putCloseable(MDC_ATTRIBUTE_NAME, ctx.getOrDefault(MDC_ATTRIBUTE_NAME, "MAAAAN"))) {
              log.debug("FINISHED: {}", requestName);
          }
      }
  })
  </code></pre>
  
  <p>There is just one problem with it. I want to log something in <code>doOnSubscribe</code>, <code>doOnError</code> and in <code>doOnSuccess</code>. While I could use doOnEach to check for <code>signal.isOnNext()</code> or <code>signal.isOnComplete()</code>, I found out that <code>signal.isOnSubscribe()</code> is never called.</p>
  
  <p>So <strong>the question is</strong>: How can I get the context in <code>doOnSubscribe()</code> or is this simply not possible?</p>