When trying to use connections created through a LettuceConnectionFactory configured with a RedisStaticMasterReplicaConfiguration (for use with ElastiCache) you get ClassCastExceptions when trying to do pub/sub:
Thanks for report. Using Master/Replica isn't going to work with Pub/Sub. First, there is no Pub/Sub implementation in Lettuce for Master/Replica. The second reason is that Redis Standalone or Replica does not propagate Pub/Sub messages across nodes. That's only available in Redis Cluster. So messages sent on one node cannot be received on a different node.
We should improve at least the exception and our docs to indicate that Pub/Sub isn't supported.
Thanks for the update, it would be helpful to note something in the docs regarding this... I assume to use pub/sub then for something like ElastiCache (non-clustered) one should just use a RedisStandaloneConfiguration pointed to the primary and let the aws failover promotion (which I believe keeps the same primary url as the target) handle things?