title: Spring Boot RSocketRequester deal with server restart
body: <p>I have a question about Springs RSocketRequester. I have a rsocket server and client. Client connects to this server and requests @MessageMapping endpoint. It works as expected.</p>
  
  <p>But what if I restart the server. How to do automatic reconnect to rsocket server from client? Thanks</p>
  
  <p>Server:</p>
  
  <pre><code>@Controller
  class RSC {
  
      @MessageMapping("pong")
      public Mono&lt;String&gt; pong(String m) {
          return Mono.just("PONG " + m);
      }
  }
  </code></pre>
  
  <p>Client:</p>
  
  <pre><code>@Bean
      public RSocketRequester rSocketRequester() {
          return RSocketRequester
                  .builder()
                  .connectTcp("localhost", 7000)
                  .block();
  
      }
  
  @RestController
  class RST {
  
      @Autowired
      private RSocketRequester requester;
  
      @GetMapping(path = "/ping")
      public Mono&lt;String&gt; ping(){
          return this.requester
                  .route("pong")
                  .data("TEST")
                  .retrieveMono(String.class)
                  .doOnNext(System.out::println);
      }
  }
  </code></pre>