Skip to content

Commit c927c50

Browse files
committed
Default errorConsumer to no-op in the new API
RSocketFactory retains its previous defaults but RSocketConnector and RSocketServer now default to a no-op. Signed-off-by: Rossen Stoyanchev <[email protected]>
1 parent d5e8a45 commit c927c50

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static class ClientRSocketFactory implements ClientTransportAcceptor {
111111
private Resume resume;
112112

113113
public ClientRSocketFactory() {
114-
this(RSocketConnector.create());
114+
this(RSocketConnector.create().errorConsumer(Throwable::printStackTrace));
115115
}
116116

117117
public ClientRSocketFactory(RSocketConnector connector) {
@@ -393,6 +393,9 @@ public ClientRSocketFactory fragment(int mtu) {
393393
return this;
394394
}
395395

396+
/**
397+
* @deprecated this is deprecated with no replacement.
398+
*/
396399
public ClientRSocketFactory errorConsumer(Consumer<Throwable> errorConsumer) {
397400
connector.errorConsumer(errorConsumer);
398401
return this;
@@ -416,7 +419,7 @@ public static class ServerRSocketFactory implements ServerTransportAcceptor {
416419
private Resume resume;
417420

418421
public ServerRSocketFactory() {
419-
this(RSocketServer.create());
422+
this(RSocketServer.create().errorConsumer(Throwable::printStackTrace));
420423
}
421424

422425
public ServerRSocketFactory(RSocketServer server) {
@@ -496,6 +499,9 @@ public ServerRSocketFactory fragment(int mtu) {
496499
return this;
497500
}
498501

502+
/**
503+
* @deprecated this is deprecated with no replacement.
504+
*/
499505
public ServerRSocketFactory errorConsumer(Consumer<Throwable> errorConsumer) {
500506
server.errorConsumer(errorConsumer);
501507
return this;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class RSocketConnector {
6969
private int mtu = 0;
7070
private PayloadDecoder payloadDecoder = PayloadDecoder.DEFAULT;
7171

72-
private Consumer<Throwable> errorConsumer = Throwable::printStackTrace;
72+
private Consumer<Throwable> errorConsumer = ex -> {};
7373

7474
private RSocketConnector() {}
7575

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class RSocketServer {
5252
private Resume resume;
5353
private Supplier<Leases<?>> leasesSupplier = null;
5454

55-
private Consumer<Throwable> errorConsumer = Throwable::printStackTrace;
55+
private Consumer<Throwable> errorConsumer = ex -> {};
5656
private PayloadDecoder payloadDecoder = PayloadDecoder.DEFAULT;
5757

5858
private RSocketServer() {}

0 commit comments

Comments
 (0)