使用dyno-queue 要注意ack时间,如果在规定时间没有ack,那么pop出来的数据会重新返回队列,可以再次pop。
设置ack时间代码如下,
/**
* @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