title: What is reason of PrematureCloseException?
body: <p>I am using spring WebFlux, and I am using WebClient,
  and it is working well, I saw two times I had this error in my logs, how can I know this connection issue happened in my side(client side) or the server side closed the connection, I copy error here:</p>
  <pre><code>reactor.netty.http.client.PrematureCloseException: Connection prematurely closed DURING response
      Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException
  </code></pre>
  <p>My Code which is client side is same as this code:</p>
  <pre><code>public void consumeServerSentEvent() {
  WebClient client = WebClient.create(&quot;http://SERVER-IP:SERVER-PORT/PATH_TO_API&quot;);
  ParameterizedTypeReference&lt;ServerSentEvent&lt;String&gt;&gt; type
   = new ParameterizedTypeReference&lt;ServerSentEvent&lt;String&gt;&gt;() {};
  
  Flux&lt;ServerSentEvent&lt;String&gt;&gt; eventStream = client.get()
    .uri(&quot;/stream-sse&quot;)
    .retrieve()
    .bodyToFlux(type);
  
  eventStream.subscribe(
    content -&gt; logger.info(&quot;Time: {} - event: name[{}], id [{}], content[{}] &quot;,
      LocalTime.now(), content.event(), content.id(), content.data()),
    error -&gt; logger.error(&quot;Error receiving SSE: {}&quot;, error),
    () -&gt; logger.info(&quot;Completed!!!&quot;));
  </code></pre>
  <p>}</p>