• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Environment Upgrade:Cache Connection Switched from Jedis to Lettuce


Ⅰ、Differences between Jedis and Lettuce

  • Jedis is synchronous and does not support asynchrony. The Jedis client instance is not thread-safe, so each thread needs a Jedis instance. Therefore, Jedis is generally used through a connection pool.
  • Lettuce is an event-driven Redis client based on the Netty framework. Its method calls are asynchronous. The Lettuce API is also thread-safe, so multiple threads can operate a single Lettuce connection to complete various operations. At the same time, Lettuce also supports connection pools.

Ⅱ、Switching from Jedis to Lettuce

(Ⅰ)Dependency Modification

Changes to the pom.xml of the boot startup project

properties

<lettuce.version>5.3.6.RELEASE</lettuce.version>
<commons-pool2.version>2.8.1</commons-pool2.version>

dependencies

<dependency>
  <groupId>pro.shushi.pamirs.framework</groupId>
  <artifactId>pamirs-connectors-data-api</artifactId>
  <exclusions>
    <exclusion>
      <groupId>redis.clients</groupId>
      <artifactId>jedis</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>io.lettuce</groupId>
  <artifactId>lettuce-core</artifactId>
  <version>${lettuce.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-pool2</artifactId>
  <version>${commons-pool2.version}</version>
</dependency>

(Ⅱ)Configuration Modification

Modifications to the application.yml configuration

spring:
  redis:
    database: 0
    host: 127.0.0.1
    port: 6379
    prefix: pamirs
    timeout: 2000
    # Optional
    password: xxxxx
    # Optional
    #  cluster:
    #    nodes:
    #      - 127.0.0.1:6379
    #    timeout: 2000
    #    max-redirects: 7
    lettuce:
      pool:
        enable: true
        max-idle: 16
        min-idle: 1
        max-active: 16
        max-wait: 2000
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Environmental Protection:Oinone Environmental Protection (above v5.2.3)
Next
Environment Deployment:Deploying Oinone Projects on TongWeb and Tomcat
默认页脚
Copyright © 2026 Mr.Hope