All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yes.tools.mq.properties.RocketMQProperties Maven / Gradle / Ivy

The newest version!
package org.yes.tools.mq.properties;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author Co.
 * @date 2022年 07月15日 16:06:44
 */
@Component
@ConfigurationProperties(prefix = "rocketmq")
public class RocketMQProperties implements InitializingBean {

    @Value("${rocketmq.namesrvAddr:127.0.0.1:9876}")
    private String namesrvAddr;

    @Value("${rocketmq.group:test-group}")
    private String group;

    @Value("${rocketmq.consumeThreadMax:10}")
    private int consumeThreadMax;

    @Value("${rocketmq.consumeThreadMin:1}")
    private int consumeThreadMin;

    @Value("${rocketmq.consumeMessageBatchMaxSize:1}")
    private int consumeMessageBatchMaxSize;

    @Value("${rocketmq.maxMessageSize:20}")
    private int maxMessageSize;


    public static String GROUP;

    public static String NAMESRV_ADDR;

    public static int CONSUME_THREAD_MAX;

    public static int CONSUME_THREAD_MIN;

    public static int CONSUME_MESSAGE_BATCH_MAX_SIZE;

    public static int MAX_MESSAGE_SIZE;

    @Override
    public void afterPropertiesSet() throws Exception {
        GROUP = group;
        NAMESRV_ADDR = namesrvAddr;
        CONSUME_THREAD_MAX = consumeThreadMax;
        CONSUME_THREAD_MIN = consumeThreadMin;
        CONSUME_MESSAGE_BATCH_MAX_SIZE = consumeMessageBatchMaxSize;
        MAX_MESSAGE_SIZE = maxMessageSize;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy