Skip to content

Commit dde1e9e

Browse files
committed
can pass port to consumer and run two consumers at once
1 parent 2145fd0 commit dde1e9e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

runconsumer2.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mvn exec:java -Dexec.mainClass="com.jphaugla.redis.streams.RedisStreams101Consumer" -Dexec.args="12002"

src/main/java/com/jphaugla/redis/streams/RedisStreams101Consumer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void main(String[] args) {
2323
RedisCommands<String, String> syncCommands = connection.sync();
2424

2525
try {
26-
syncCommands.xgroupCreate( XReadArgs.StreamOffset.from(STREAMS_KEY, "0-0"), "application_1" );
26+
syncCommands.xgroupCreate( XReadArgs.StreamOffset.from(STREAMS_KEY, "0-0"), "application_1", XGroupCreateArgs.Builder.mkstream() );
2727
}
2828
catch (RedisBusyException redisBusyException) {
2929
System.out.printf("\t Group '%s' already exists%n", "application_1");

0 commit comments

Comments
 (0)