com.redis.riot.PingExecutionItemReader Maven / Gradle / Ivy
package com.redis.riot;
import org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader;
import org.springframework.util.ClassUtils;
import io.lettuce.core.api.sync.RedisCommands;
public class PingExecutionItemReader extends AbstractItemCountingItemStreamItemReader {
private final RedisCommands redisCommands;
public PingExecutionItemReader(RedisCommands redisCommands) {
setName(ClassUtils.getShortName(getClass()));
this.redisCommands = redisCommands;
}
@Override
protected void doOpen() throws Exception {
// do nothing
}
@Override
protected void doClose() throws Exception {
// do nothing
}
@Override
protected PingExecution doRead() throws Exception {
return new PingExecution().reply(redisCommands.ping());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy