Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Created May 7, 2022 14:25
Show Gist options
  • Save ahndmal/60462ab1bbda7c5b04e65e2901c1e2c6 to your computer and use it in GitHub Desktop.
Save ahndmal/60462ab1bbda7c5b04e65e2901c1e2c6 to your computer and use it in GitHub Desktop.
@Component
public record RClient() {
@EventListener(ApplicationReadyEvent.class)
public void ready() {
var source = RSocketConnector.create()
.reconnect(Retry.backoff(50, Duration.ofMillis(500)))//
.connect(TcpClientTransport.create("localhost", 7766));
RSocketClient.from(source).fireAndForget(Mono.just(DefaultPayload.create("Reactive Spring!"))).block();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment