title: How to guide a new message that holds the current correlation id in an exception flow
body: <p>After the splitter, an exception occurs when processing a message. I want to treat that exception and direct to the common channel a new message with the correlation id of that message that produced the exception and a special header that indicates the error.</p>
  
  <p>I've tried it this way:</p>
  
  <pre><code>@Bean
  public IntegrationFlow socialMediaErrorFlow() {
       return IntegrationFlows.from("socialMediaErrorChannel")
             .wireTap(sf -&gt; sf.handle("errorService", "handleException"))
             .handle((p, h) -&gt; MessageBuilder.withPayload(p).copyHeaders(h).setHeader("ERROR", true).build())
             .channel("directChannel_2")
             .get();
  }
  </code></pre>
  
  <p><strong>But the aggregator returns this error:</strong></p>
  
  <pre><code>MessageHandlingException: error occurred in message handler [org.springframework.integration.dsl.AggregatorSpec$InternalAggregatingMessageHandler#0]; nested exception is java.lang.IllegalStateException: Null correlation not allowed.  Maybe the CorrelationStrategy is failing?
  </code></pre>
  
  <p>I can not copy the correlation id in the message header.</p>
  
  <p>Does anyone know I'm doing wrong? Thanks in advance.</p>