title: How to use Spring Reactive WebSocket and transform it into the Flux stream?
body: <p>There is some <code>WebSocketClient</code> example on <a href="https://docs.spring.io/spring/docs/5.0.0.M4/spring-framework-reference/html/web-reactive.html" rel="nofollow noreferrer">Spring documentation</a>:</p>
  
  <pre><code>WebSocketClient client = new ReactorNettyWebSocketClient();
  client.execute("ws://localhost:8080/echo"), session -&gt; {...}).blockMillis(5000);
  </code></pre>
  
  <p>Im not sure how to handle stream of incomming data?
  Inside that block <code>{...}</code>.</p>
  
  <p>I mean: how can I filter incoming data and cast it into Flux?</p>
  
  <p>Here is what I want to get. </p>
  
  <pre><code>@GetMapping("/stream", produces = MediaType.APPLICATION_STREAM_JSON_VALUE)
      public Flux&lt;MyRecourse&gt; getStreaming() {
  
      //  get some data from WebSocket (CoinCap service).
      //  Transform that data into MyRecourse object
      //  Return stream to a client 
  
  }
  </code></pre>