Skip to content

More than one client is created when consumer.group and consumer.topic is used in application.properties #450

@soglad

Description

@soglad

In [ISSUE #306 ], consumer.group and consumer.topic have been used as a condition to auto create a pull consumer. This creates an additional consumer implicitly for an application which use these 2 properties after upgrading to a new version of the rocket-spring-starter(version after 2.2.0). Since the additional pull consumer also consume the same topic, the application owner may not aware their original consumer cannot consume all the messages any more.

Spring application which use consumer.group and consumer.group.

@SpringBootApplication
public class ExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(ExampleApplication.class, args);
    }

    @Service
    @RocketMQMessageListener(consumerGroup = "${rocketmq.consumer.group}", topic = "${rocketmq.consumer.topic}")
    class ConsumerService  implements RocketMQListener<MessageExt>{

        @Override
        public void onMessage(MessageExt message) {
            System.out.println(LocalDateTime.now() + "\t" + message.toString());
        }
    }
}

application.properties

rocketmq.name-server=127.0.0.1:9876
rocketmq.consumer.group=test-group
rocketmq.consumer.topic=test-topic

I suggest to give some description about the resolved usage of the two properties in somewhere. Or give some log info about the creation of the pull consumer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions