@@ -17,13 +17,15 @@ public class ReaderSettings {
17
17
private final String consumerName ;
18
18
private final String readerName ;
19
19
private final List <TopicReadSettings > topics ;
20
+ private final RetryMode retryMode ;
20
21
private final long maxMemoryUsageBytes ;
21
22
private final Executor decompressionExecutor ;
22
23
23
24
private ReaderSettings (Builder builder ) {
24
25
this .consumerName = builder .consumerName ;
25
26
this .readerName = builder .readerName ;
26
27
this .topics = ImmutableList .copyOf (builder .topics );
28
+ this .retryMode = builder .retryMode ;
27
29
this .maxMemoryUsageBytes = builder .maxMemoryUsageBytes ;
28
30
this .decompressionExecutor = builder .decompressionExecutor ;
29
31
}
@@ -37,6 +39,10 @@ public String getReaderName() {
37
39
return readerName ;
38
40
}
39
41
42
+ public RetryMode getRetryMode () {
43
+ return retryMode ;
44
+ }
45
+
40
46
public List <TopicReadSettings > getTopics () {
41
47
return topics ;
42
48
}
@@ -61,6 +67,7 @@ public static class Builder {
61
67
private boolean readWithoutConsumer = false ;
62
68
private String readerName = null ;
63
69
private List <TopicReadSettings > topics = new ArrayList <>();
70
+ private RetryMode retryMode = RetryMode .ALWAYS ;
64
71
private long maxMemoryUsageBytes = MAX_MEMORY_USAGE_BYTES_DEFAULT ;
65
72
private Executor decompressionExecutor = null ;
66
73
@@ -81,6 +88,7 @@ public Builder withoutConsumer() {
81
88
82
89
/**
83
90
* Set reader name for debug purposes
91
+ * @param readerName name of reader
84
92
* @return settings builder
85
93
*/
86
94
public Builder setReaderName (String readerName ) {
@@ -98,6 +106,16 @@ public Builder setTopics(List<TopicReadSettings> topics) {
98
106
return this ;
99
107
}
100
108
109
+ /**
110
+ * Set {@link RetryMode} to define behavior of the stream internal retries
111
+ * @param mode retry mode
112
+ * @return settings builder
113
+ */
114
+ public Builder setRetryMode (RetryMode mode ) {
115
+ this .retryMode = mode ;
116
+ return this ;
117
+ }
118
+
101
119
public Builder setMaxMemoryUsageBytes (long maxMemoryUsageBytes ) {
102
120
this .maxMemoryUsageBytes = maxMemoryUsageBytes ;
103
121
return this ;
0 commit comments