package com.hdkj.lt.core.mq.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.io.Serializable;
import java.util.List;

/**
 * @Description:
 * @Author: wenhao
 * @Create: 2024/06/06 10:19
 * @Version: 1.0
 */
@Getter
@Setter
@ConfigurationProperties(prefix = "lt.mq.rocketmq")
public class RocketMQProperties {

    private Boolean enabled =  false;

    private String nameServer;

    private String group;

    private String accessKey;

    private String secretKey;

    private Long timeoutMillis = 3000L;

    private Producer producer;

    private Consumer consumer;

    private List<Topic> topic;

    @Getter
    @Setter
    public static class Producer implements Serializable {
    }

    @Getter
    @Setter
    public static class Consumer implements Serializable {

        private Integer threadNums = 10;

        private Integer maxReconsumeTimes = 0;

    }

    @Getter
    @Setter
    public static class Topic implements Serializable {

        private String topicId;

        private String topicName;

        private String listenerClass;

    }

}
