spring-cloud-stream-redis
  • 介绍
  • 快速开始
  • 安装
  • 配置
  • 健康检查
  • 更新日志
  • Maven central version
  • 简体中文
  • English
GitHub
  • 介绍
  • 快速开始
  • 安装
  • 配置
  • 健康检查
  • 更新日志
  • Maven central version
  • 简体中文
  • English
GitHub
  • 指南

    • 介绍
    • 快速开始
    • 安装
    • 配置
    • 健康检查

配置

spring-cloud-stream-redis 的配置异常的简单,我们仅需要一些简单的配置即可!

请确保您已经安装了 spring-cloud-stream-redis,如果您尚未安装,请查看 安装。

Redis

application.yml 配置 连接参数

支持redis单机版、集群、哨兵模式

支持spring.data.redis下的所有配置

spring:
  cloud:
    function:
#      definition: send;test
      definition: send
    stream:
      default-binder: redis
      binders:
        redis:
          type: redis
      redis:
        binder:
          configuration:
            host: 127.0.0.1
            port: 6379
            password: 123456
            database: 7
          support-type: queue_channel
#        bindings:
#          send-in-0:
#            consumer:
#              destination-is-pattern: true
      bindings:
        out-0:
          destination: test-topic
          content-type: text/plain
          group: test-producer-group
        send-in-0:
          destination: test-topic
          content-type: text/plain
          group: test-send-group

可选客户端

默认与 使用lettuce客户端,如需切换 jedis 客户端,可以添加 jedis 依赖 即可,配置参数与 spring-boot-starter-data-redis 一致。

  • jedis依赖
  • 配置
spring:
  cloud:
    function:
#      definition: send;test
      definition: send
    stream:
      default-binder: redis
      binders:
        redis:
          type: redis
      redis:
        binder:
          configuration:
            host: 127.0.0.1
            port: 6379
            password: 123456
            database: 7
            client-type: jedis
            jedis:
            pool:
              enabled: true
              max-idle: 8
              max-active: 8

一般的简单工程,通过以上配置即可正常使用,具体可参考以下项目: spring-cloud-stream-redis-samples

在 GitHub 上编辑此页
上次更新:
Prev
安装
Next
健康检查