Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is DefaultMQPullConsumer use RmqProducerGroup correct in ConnectUtil class? #803

Open
lizhiboo opened this issue Aug 31, 2021 · 2 comments
Labels

Comments

@lizhiboo
Copy link
Contributor

line 87 in ConnectUtil

    public static DefaultMQProducer initDefaultMQProducer(ConnectConfig connectConfig) {
        DefaultMQProducer producer = new DefaultMQProducer();
        producer.setNamesrvAddr(connectConfig.getNamesrvAddr());
        producer.setInstanceName(createInstance(connectConfig.getNamesrvAddr()));
        producer.setProducerGroup(createGroupNameV2(connectConfig.getRmqProducerGroup()));
        producer.setSendMsgTimeout(connectConfig.getOperationTimeout());
        producer.setMaxMessageSize(RuntimeConfigDefine.MAX_MESSAGE_SIZE);
        producer.setLanguage(LanguageCode.JAVA);
        return producer;
    }

    public static DefaultMQPullConsumer initDefaultMQPullConsumer(ConnectConfig connectConfig) {
        DefaultMQPullConsumer consumer = new DefaultMQPullConsumer();
        consumer.setNamesrvAddr(connectConfig.getNamesrvAddr());
        consumer.setInstanceName(createInstance(connectConfig.getNamesrvAddr()));
87      consumer.setConsumerGroup(createGroupNameV2(connectConfig.getRmqProducerGroup()));
        consumer.setMaxReconsumeTimes(connectConfig.getRmqMaxRedeliveryTimes());
        consumer.setBrokerSuspendMaxTimeMillis(connectConfig.getBrokerSuspendMaxTimeMillis());
        consumer.setConsumerPullTimeoutMillis((long) connectConfig.getRmqMessageConsumeTimeout());
        return consumer;
    }
@odbozhou
Copy link
Contributor

odbozhou commented Sep 1, 2021

In the current design, different workerTasks handle different topics. One workerTask corresponds to one pullConsumer, which improves concurrency to a certain extent, so there is no problem using different consumerGroups.

@lizhiboo
Copy link
Contributor Author

lizhiboo commented Sep 1, 2021

In the current design, different workerTasks handle different topics. One workerTask corresponds to one pullConsumer, which improves concurrency to a certain extent, so there is no problem using different consumerGroups.

it's weird use producerGroup to create PullConsumer, consumerGroup config is redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants