I am trying to RPUSH a string with blank spliter into a Redis List, but when I using the RPUSH in RedisSinkBuilder, the string cannot be splited.
Code:
RedisSinkBuilder<Tuple2<String, String>> builder = new RedisSinkBuilder<>();
RedisSink<Tuple2<String, String>> redisSink = builder
.redisMapper(new Tuple2RedisMapper())
.syncType(RedisSyncType.ASYNC)
.deployType(RedisType.STANDALONE)
.hostname(redisTestHost)
.port(redisTestPort)
.dataType(RedisDataType.LIST)
.redisCommand(RedisCommand.RPUSH)
.additionalTTL(60)
.build();
testDataStream.addSink(redisSink).name("test");
Example:
key: "test"
value: "1 2 3 4 5"
Expected Data in Redis:
1)"1"
2)"2"
3)"3"
4)“4"
5)"5"
However, I got only 1 element in the test list:
1)"1 2 3 4 5"
Any ideas on how I can RPUSH multiple elements in a string into a list in Redis?
Many Thanks!