初始化v1.2
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.tongran.rocketmq.model;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 消费者初始化
|
||||
* 消费者连接信息 具体看nacos配置
|
||||
*/
|
||||
@Data
|
||||
@Configuration
|
||||
@Component
|
||||
public class ConsumerMode {
|
||||
@Value("${suning.rocketmq.namesrvAddr}")
|
||||
private String namesrvAddr;
|
||||
@Value("${suning.rocketmq.conumer.groupName}")
|
||||
private String groupName ;
|
||||
@Value("${suning.rocketmq.conumer.consumeThreadMin}")
|
||||
private int consumeThreadMin;
|
||||
@Value("${suning.rocketmq.conumer.consumeThreadMax}")
|
||||
private int consumeThreadMax;
|
||||
@Value("${suning.rocketmq.conumer.consumeMessageBatchMaxSize}")
|
||||
private int consumeMessageBatchMaxSize;
|
||||
@Value("${suning.rocketmq.conumer.agentTopic}")
|
||||
private String agentTopic;
|
||||
@Value("${suning.rocketmq.conumer.agentGroup}")
|
||||
private String agentGroup;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.tongran.rocketmq.model;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* 生产者初始化
|
||||
*/
|
||||
@RefreshScope
|
||||
@Data
|
||||
@Configuration
|
||||
public class ProducerMode {
|
||||
@Value("${suning.rocketmq.producer.groupName}")
|
||||
private String groupName;
|
||||
@Value("${suning.rocketmq.producer.agentTopic}")
|
||||
private String agentTopic;
|
||||
@Value("${suning.rocketmq.producer.agentGroup}")
|
||||
private String agentGroup;
|
||||
@Value("${suning.rocketmq.namesrvAddr}")
|
||||
private String namesrvAddr;
|
||||
@Value("${suning.rocketmq.producer.maxMessageSize}")
|
||||
private Integer maxMessageSize;
|
||||
@Value("${suning.rocketmq.producer.sendMsgTimeout}")
|
||||
private Integer sendMsgTimeout;
|
||||
@Value("${suning.rocketmq.producer.retryTimesWhenSendFailed}")
|
||||
private Integer retryTimesWhenSendFailed;
|
||||
}
|
||||
Reference in New Issue
Block a user