|
|
@ -4,17 +4,35 @@ import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; |
|
|
|
import com.epmet.commons.rocketmq.constants.TopicConstants; |
|
|
|
import com.epmet.commons.rocketmq.register.MQAbstractRegister; |
|
|
|
import com.epmet.commons.rocketmq.register.MQConsumerProperties; |
|
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.mq.listener.IssueProjectCategoryTagInitListener; |
|
|
|
import com.epmet.service.IssueProjectCategoryDictService; |
|
|
|
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
@Component |
|
|
|
public class RocketMQConsumerRegister extends MQAbstractRegister { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IssueProjectCategoryDictService issueProjectCategoryDictService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DistributedLock distributedLock; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { |
|
|
|
// 客户初始化监听器注册
|
|
|
|
register(consumerProperties, ConsomerGroupConstants.ISSUE_PROJECT_CATEGORY_TAG, MessageModel.CLUSTERING, TopicConstants.INIT_CUSTOMER, "*", new IssueProjectCategoryTagInitListener()); |
|
|
|
register(consumerProperties, |
|
|
|
ConsomerGroupConstants.ISSUE_PROJECT_CATEGORY_TAG, |
|
|
|
MessageModel.CLUSTERING, |
|
|
|
TopicConstants.INIT_CUSTOMER, |
|
|
|
"*", |
|
|
|
new IssueProjectCategoryTagInitListener(issueProjectCategoryDictService, distributedLock, redisUtils)); |
|
|
|
|
|
|
|
// ...其他监听器类似
|
|
|
|
} |
|
|
|