1、yml配置文件

rocketmq: #mq配置
  producer:
    iseffect: true
    type: default # (transaction,default) transaction:TransactionMQProducer; default:DefaultMQProducer
    groupName: testzjlGroup
    topicName: test_topic
    namesrvAddr: 192.168.244.128:9876
  consumer:
    iseffect: true
    type: default # (transaction,default) transaction:TransactionMQProducer; default:DefaultMQProducer
    groupName: testzjlGroup
    topicName: test_topic
    namesrvAddr: 192.168.244.128:9876

2、对应的java类

package com.gofun.customer.mq;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "rocketmq.producer")
public class RocketMqProducerProperties {

    private Boolean iseffect;
    private String type;
    private String groupName;
    private String topicName;
    private String namesrvAddr;

    public Boolean getIseffect() {
        return iseffect;
    }

    public void setIseffect(Boolean iseffect) {
        this.iseffect = iseffect;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getTopicName() {
        return topicName;
    }

    public void setTopicName(String topicName) {
        this.topicName = topicName;
    }

    public String getNamesrvAddr() {
        return namesrvAddr;
    }

    public void setNamesrvAddr(String namesrvAddr) {
        this.namesrvAddr = namesrvAddr;
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2023-04-10
  • 2021-09-03
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2022-02-17
  • 2021-04-11
相关资源
相似解决方案