Describe the bug
CacheManager library does not handle RESP3 protocol properly. RESP3 is a new version of Redis protocol that is now supported by StackExchange.Redis and it is automagically preferred when, for example, connected to AMR (Azure Managed Redis).
When RESP3 is used, some operations may return different data types than before. CacheManager can't handle this change.
See: https://stackexchange.github.io/StackExchange.Redis/Resp3
To Reproduce
Steps to reproduce the behavior:
- Configure CacheManager to connect to AMR instance
- Call CacheManagerInstance.Get(key) where CacheManagerInstance is ICacheManager and key is a string
- Observe exception: System.InvalidCastException: Unable to cast object of type 'System.Byte[]' to type 'System.String'.
at CacheManager.Core.Internal.BaseCache`1.GetCasted[TOut](Object value)...
Expected behavior
When CacheManager is connected to Azure Managed Redis, RESP3 should be used (as preferred by StackExchange.Redis) and there should be no exceptions from CacheManager.
Additional context
The workaround for now is to hardcode the protocol to RESP2 when configuring Redis protocol. See https://stackexchange.github.io/StackExchange.Redis/Resp3
Describe the bug
CacheManager library does not handle RESP3 protocol properly. RESP3 is a new version of Redis protocol that is now supported by StackExchange.Redis and it is automagically preferred when, for example, connected to AMR (Azure Managed Redis).
When RESP3 is used, some operations may return different data types than before. CacheManager can't handle this change.
See: https://stackexchange.github.io/StackExchange.Redis/Resp3
To Reproduce
Steps to reproduce the behavior:
at CacheManager.Core.Internal.BaseCache`1.GetCasted[TOut](Object value)...
Expected behavior
When CacheManager is connected to Azure Managed Redis, RESP3 should be used (as preferred by StackExchange.Redis) and there should be no exceptions from CacheManager.
Additional context
The workaround for now is to hardcode the protocol to RESP2 when configuring Redis protocol. See https://stackexchange.github.io/StackExchange.Redis/Resp3