title: Restarting inifinite Flux on error with pubSubReactiveFactory
body: <p>I'm developing an application which uses reactor libraries to connect with Google pubsub. So I have a Flux of messages. I want it to always consume from the queue, no matter what happens: this means handling all errors in order not to terminate the flux. I was thinking about the (very unlikely) event the connection to pubsub may be lost or whatever may cause the just created Flux to signal an error. I came up with this solution:</p>
  <pre class="lang-java prettyprint-override"><code>
      private final PubSubReactiveFactory pubSubReactiveFactory;
      private final String requestSubscription;
      private final Long requestPollTime;
      private final Flux&lt;AcknowledgeablePubsubMessage&gt; requestFlux;
  
      @Autowired
      public FluxContainer(/* Field args...*/) {
          // init stuff...
          this.requestFlux = initRequestFlux();
      }
  
      private Flux&lt;AcknowledgeablePubsubMessage&gt; initRequestFlux() {
          return pubSubReactiveFactory.poll(requestSubscription, requestPollTime);
                  .doOnError(e -&gt; log.error(&quot;FATAL ERROR: could not retrieve message from queue. Resetting flux&quot;, e))
                  .onErrorResume(e -&gt; initRequestFlux());
      }
  
      @EventListener(ApplicationReadyEvent.class)
      public void configureFluxAndSubscribe() {
          log.info(&quot;Setting up requestFlux...&quot;);
          this.requestFlux
                  .doOnNext(AcknowledgeablePubsubMessage::ack)
                  // ...many more concatenated calls handling flux
      }
  </code></pre>
  <p>Does it makes sense? I'm concerned about memory allocation (I'm relying on the gc to clean stuff). Any comment is welcome.</p>