/** * @param clock Time provider * @param quorumConn Dyno connection with dc_quorum enabled * @param nonQuorumConn Dyno connection to local Redis * @param redisKeyPrefix prefix applied to the Redis keys * @param shardSupplier Provider for the shards for the queues created * @param unackTime Time in millisecond within which a message needs to be acknowledged by the client, after which the message is re-queued. * @param unackHandlerIntervalInMS Time in millisecond at which the un-acknowledgement processor runs * @param shardingStrategy sharding strategy responsible for calculating message's destination shard */ public RedisQueues(Clock clock, JedisCommands quorumConn, JedisCommands nonQuorumConn, String redisKeyPrefix, ShardSupplier shardSupplier, int unackTime, int unackHandlerIntervalInMS, ShardingStrategy shardingStrategy) { this.clock = clock; this.quorumConn = quorumConn; this.nonQuorumConn = nonQuorumConn; this.redisKeyPrefix = redisKeyPrefix; this.allShards = shardSupplier.getQueueShards(); this.shardName = shardSupplier.getCurrentShard(); this.unackTime = unackTime; this.unackHandlerIntervalInMS = unackHandlerIntervalInMS; this.queues = new ConcurrentHashMap<>(); this.shardingStrategy = shardingStrategy; }