Skip to content

[Feature]: Unified Redis Session Client #610

@benym

Description

@benym

AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.

Is your feature request related to a problem? Please describe.
The current JedisSeesion uses JedisPool, which only supports standalone scenarios. In production environments, users mostly use more complex deployment methods, such as sentinels, clusters, and master-slave setups. Furthermore, in a Java environment, users may use different Redis client implementations, such as Jedis, Lettuce, and Redisson. If each is used independently, scaling up with different Redis client implementations would result in a lot of duplicate code. Moreover, naming conventions like JedisSeesion are unclear, as they are all essentially types of Redis clients.

Describe the solution you'd like

  • Create RedisSession, uniformly implement Session creation based on Redis. Through passing different clients, the underlying layer can be switched. Internally, RedisClientAdapter is uniformly used for operations.
  • Create the RedisClientAdapter interface, and have Jedis, Lettuce, and Redisson respectively implement this interface.
  • Replace the already deprecated JedisPool with more modern APIs in Jedis, Lettuce, and Redisson. Allow the options of standalone, sentinel, cluster, and master-slave to be determined by the user side. This is more conducive to the subsequent integration and packaging with microservice frameworks such as Spring Boot Starter or Quark.

Describe alternatives you've considered
Add the lettuce dependency to the existing code and mark JedisSession and RedissonSession as deprecated.

Additional context
see releated pr #611

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions