title: How to access a flux in the middle of a Spring Integration flow?
body: <p>I try to access the flux object in Spring Integration without splitting the flow declaration to two functions. I wonder how can I perform the following:</p>
  <pre class="lang-java prettyprint-override"><code>@Bean
  public IntegrationFlow mainFlow() {
     return IntegrationFlows.from(somePublisher)
        // Access publisher here to perform something like:
        .handle(flux -&gt; flux.buffer(Duration.ofMillis(200))
        .handle(writeToS3)
        .get();
  }
  </code></pre>
  <p>I don't mind moving the flux operation that I'm talking about in the comments to another class (maybe for being some kind of a gateway), but it's obviously very important to me to start and the flow from the same <code>mainFlow</code> function, so it will be super clear and readable to understand what I'm doing in my application. I saw <a href="https://docs.spring.io/spring-integration/reference/html/gateway.html#reactor-mono" rel="nofollow noreferrer">the documentation of gateways with Monos</a>, but the example code is not even possible (they talk about Flux that is not inside a function and it's super hard for me as a beginner to understand what's going on there).</p>