server: port: 8080 spring: application: name: redis-stream-demo redis: host: localhost port: 6379 password: database: 0 timeout: 2000ms lettuce: pool: max-active: 8 max-wait: -1ms max-idle: 8 min-idle: 0 # Redis Stream Configuration redis: stream: key: "message-stream" consumer-group: "message-consumer-group" consumer-name: "message-consumer" # 消费者模式配置 consumer: # 默认模式: stream-listener, manual-ack, both default-mode: "both" # 是否启用 StreamListener 模式 stream-listener-enabled: true # 是否启用 Manual Ack 模式 manual-ack-enabled: true # StreamListener 配置 stream-listener: # 是否自动启动 auto-start: false # 是否处理历史消息(true: 从开头读取所有消息,false: 只读取新消息) process-historical-messages: true # 轮询超时时间(秒) poll-timeout: 1 # 线程池核心线程数 core-pool-size: 2 # 线程池最大线程数 max-pool-size: 4 # 线程空闲时间(秒) keep-alive-time: 60 # Manual Ack 配置 manual-ack: # 默认批量大小 default-batch-size: 10 # 最大批量大小 max-batch-size: 100 # 轮询间隔(毫秒) poll-interval: 1000 # 是否启用并发处理 concurrent-processing: false # 最大并发数 max-concurrency: 5 # Logging Configuration logging: level: com.example: DEBUG org.springframework.data.redis: DEBUG io.lettuce: DEBUG