Skip to content

Commit d1fb0ec

Browse files
committed
fixes docs
Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 27f24c3 commit d1fb0ec

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

rsocket-core/src/main/java/io/rsocket/RSocketFactory.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ public ClientRSocketFactory singleSubscriberRequester() {
259259
*
260260
* }</pre>
261261
*
262-
* Apart of the shared behavior, if the connection is lost, the same {@code Mono<RSocket>} instance
263-
* will transparently re-establish the connection for subsequent subscribers.<br>
262+
* Apart of the shared behavior, if the connection is lost, the same {@code Mono<RSocket>}
263+
* instance will transparently re-establish the connection for subsequent subscribers.<br>
264264
* For example:
265265
*
266266
* <pre>{@code
@@ -290,6 +290,24 @@ public ClientRSocketFactory singleSubscriberRequester() {
290290
*
291291
* }</pre>
292292
*
293+
* <b>Note,</b> having reconnect() enabled does not eliminate the need to accompany each
294+
* individual request with the corresponding retry logic. For example:
295+
*
296+
* <pre>{@code
297+
* Mono<RSocket> sharedRSocketMono =
298+
* RSocketFactory
299+
* .connect()
300+
* .singleSubscriberRequester()
301+
* .reconnect(Retry.fixedDelay(3, Duration.ofSeconds(1)))
302+
* .transport(transport)
303+
* .start();
304+
*
305+
* sharedRSocket.flatMap(rSocket -> rSocket.requestResponse(...))
306+
* .retryWhen(ownRetry)
307+
* .subscribe()
308+
*
309+
* }</pre>
310+
*
293311
* @param retrySpec a retry factory applied for {@link Mono#retryWhen(Retry)}
294312
* @return a shared instance of {@code Mono<RSocket>}.
295313
*/

0 commit comments

Comments
 (0)