@@ -89,9 +89,14 @@ private RedisStreamSpoutConfig(
89
89
) {
90
90
// Connection
91
91
if (redisCluster != null && redisServer != null ) {
92
- throw new IllegalStateException ("TODO" );
92
+ throw new IllegalStateException (
93
+ "You cannot configure connection details for both a single Redis server and RedisCluster. "
94
+ + "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
95
+ + "If talking to a single Redis instance use Builder.withServer(). "
96
+ + "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
97
+ );
93
98
} else if (redisCluster == null && redisServer == null ) {
94
- throw new IllegalStateException ("TODO " );
99
+ throw new IllegalStateException ("You must configure connection details for either a single Redis server and RedisCluster. " );
95
100
}
96
101
97
102
this .redisCluster = redisCluster ;
@@ -254,7 +259,12 @@ public Builder withServer(final String host, final int port, final String passwo
254
259
private Builder withServer (final RedisServer redisServer ) {
255
260
if (!clusterNodes .isEmpty ()) {
256
261
// Cannot define both cluster servers and redis server instances.
257
- throw new IllegalArgumentException ("TODO" );
262
+ throw new IllegalStateException (
263
+ "You cannot configure connection details for both a single Redis server and RedisCluster. "
264
+ + "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
265
+ + "If talking to a single Redis instance use Builder.withServer(). "
266
+ + "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
267
+ );
258
268
}
259
269
this .redisServer = Objects .requireNonNull (redisServer );
260
270
return this ;
@@ -301,7 +311,12 @@ public Builder withClusterNode(final String host, final int port, final String p
301
311
private Builder withClusterNode (final RedisServer node ) {
302
312
if (redisServer != null ) {
303
313
// Cannot define both cluster servers and redis server instances.
304
- throw new IllegalArgumentException ("TODO" );
314
+ throw new IllegalStateException (
315
+ "You cannot configure connection details for both a single Redis server and RedisCluster. "
316
+ + "Use either Builder.withServer() OR Builder.withClusterNode(), but NOT both. "
317
+ + "If talking to a single Redis instance use Builder.withServer(). "
318
+ + "If talking to a RedisCluster use Builder.withClusterNode() to configure one or more nodes in the cluster."
319
+ );
305
320
}
306
321
clusterNodes .add (Objects .requireNonNull (node ));
307
322
return this ;
0 commit comments