要求 (書き込み/読み取り) ごとに RedisTemplate をオンデマンドで作成する必要があります。connectionfactory は JedisConnectionFactory です。
JedisConnectionFactory factory=new
JedisConnectionFactory(RedisSentinelConfiguration,JedisPoolConfig);
一度、RedisTemplate.opsForHash/opsForValue を使用して、テンプレートを安全に破棄する方法を実行し、接続が JedisPool に返されるようにします。
今のところ、私はこれを
template.getConnectionFactory().getConnection().close();
これは正しい方法ですか?