0

I'm using AWS ElastiCache in cluster mode and enabled the notification to EX. In dev env I'm getting 1 notification for each unique key expiry but in staging getting 2 notification per key expiry any config which I can change to get unique notification?

New contributor
Saurav Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • This is not about programming. Commented Nov 19 at 7:36

1 Answer 1

1

In Redis Cluster Mode, getting two expiry notifications is actually pretty common. It usually happens because your app ends up subscribing to more than one shard/node, so both nodes fire the same expiry event. Dev likely connects to only one shard, but staging doesn’t.

or or Other possible causes:

  1. A recent failover or resharding (Redis may send events from both old and new masters)

  2. Different persistence settings (AOF/RDB) causing events to replay

  3. Differences in parameter groups between Dev and Staging

There’s no Redis or ElastiCache setting that guarantees “only one notification per key.” The reliable fix is to deduplicate on the consumer side, or ensure your app subscribes only once to the correct shard. Good Luck!

Thanks, Rajat Mishra

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.