spring cloud stream整合rocketmq相关参数

pom.xml


    
        
            com.alibaba.cloud
            spring-cloud-alibaba-dependencies
            2.2.6.RELEASE
            pom
            import
        

    




    
        com.alibaba.cloud
        spring-cloud-starter-stream-rocketmq
        
            
                org.apache.rocketmq
                rocketmq-spring-boot-starter
            
        
    

    
        org.apache.rocketmq
        rocketmq-spring-boot-starter
        2.0.2
    

参数配置前缀与其功能如下

spring.cloud.stream.rocketmq.binder

对应配置类RocketMQBinderConfigurationProperties,指定 name server 配置

示例

spring:
  cloud:
    stream:
      rocketmq:
        binder:
          name-server: localhost:9876

spring.cloud.stream

对应配置类BindingServiceProperties,定义生产者和消费者

示例

spring:
  cloud:
    stream:
      bindings:
        output1:
          destination: test-topic

spring.cloud.stream.rocketmq

对应配置类RocketMQExtendedBindingProperties,定义生产者和消费者的扩展参数

示例

spring:
  cloud:
    stream:
      rocketmq:
        bindings:
          output2:
            producer:
              sync: true
              sendMessageTimeout: 10000
        binder:
          name-server: localhost:9876
        output1:
          destination: use-spring-cloud-alibaba-async-topic
        output2:
          destination: use-spring-cloud-alibaba-sync-topic

sync指定生产者是否同步生产消息

你可能感兴趣的:(消息队列,java-rocketmq,rocketmq,java)