File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
rsocket-core/src/main/java/io/rsocket Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,8 @@ public ClientRSocketFactory singleSubscriberRequester() {
259
259
*
260
260
* }</pre>
261
261
*
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>
264
264
* For example:
265
265
*
266
266
* <pre>{@code
@@ -290,6 +290,24 @@ public ClientRSocketFactory singleSubscriberRequester() {
290
290
*
291
291
* }</pre>
292
292
*
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
+ *
293
311
* @param retrySpec a retry factory applied for {@link Mono#retryWhen(Retry)}
294
312
* @return a shared instance of {@code Mono<RSocket>}.
295
313
*/
You can’t perform that action at this time.
0 commit comments