Igniters, I would like to add WithExpirePolicy support to thin clients. [1] For a thick client, we can obtain a reference to a cache wrapper instance and use cache API through it. At the same time, the thin client protocol is stateless, we do not hold a reference to a cache but rather a cache name identifier is used for a server to create an appropriate cache instance.
We could extend the protocol as we did with WithKeepBinaryMethod: every time we need to call some API on a cache with expiration, a serialized ExpiryPolicy (additional 3*8 bytes) would be sent. This approach works well, but things could get worse if we decided to add a few more WithSomething* methods. Initially, I was thinking about introducing some state context to a protocol, similar to a QueryCursor API. For instance, we can save an expire policy configuration for the first call and use some hash value based on an ExpiryPolicy for further calls, just as we do for cache names. I.e. newCacheId = [cacheId, new AdditionalValues(expiryPolicyId, binaryModeId, ....)] But this approach complicates logic and leads to additional memory consumption. I think it's ok for now to use the first approach with ExpiryPolicy serialization. But any ideas are welcome. [1] - https://issues.apache.org/jira/browse/IGNITE-9033