Is it needed to separate producer and consumer in RocketMQAutoConfiguration
See original GitHub issueFEATURE REQUEST
RocketMQAutoConfiguration
automatically imports ListenerContainerConfiguration
and will start all consumers’ listening threads after springboot starts.
But in a normal project, I actually need to separate the producer and the consumer. They may be placed in two projects separately. At present, I have not found that the official code has the function of turning on/off the listener uniformly.
RocketMQAutoConfiguration
自动 import 了 ListenerContainerConfiguration
在 springboot 启动后会开启所有消费者的监听线程,
但是在正常项目中, 其实我是需要把 producer 和 consumer 分开的,可能是分别放在两个项目里面, 目前没有发现官方的代码里有统一开启/关闭 listener 的功能
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Use rocketmq-spring-boot-starter to Configure, Send, and ...
The spring-boot-starter will be encapsulated separately on the producer and the consumer. In the current implementation, a compatible method is ...
Read more >Spring Tips: Apache RocketMQ
Let's look at a simple producer class that uses the Spring Boot autoconfiguration and the RocketMQTemplate . In order to work with this,...
Read more >Basic Best Practices - RocketMQ
This section describes the behavior configuration common to producers and consumers.
Read more >rocketmq-spring/RocketMQAutoConfiguration.java at master
java. This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read more >Spring Tips: Apache RocketMQ - DZone Java
You'll need to use Java 8 when running Apache RocketMQ. (You can use any version of Java when writing Spring applications that connect...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
我自己写了AOP并配合配置中心的配置,在不需要消费者的项目里统一把消费者取消注入了。 具体就是AOP切面切入 ListenerContainerConfiguration.afterSingletonsInstantiated() 方法,然后around()方法不做任何操作直接返回void,以此达到不注入所有用RocketMQMessageListener注解的消费者实例,切面类本身用外部配置配合ConditionalOnProperty注解控制,可以实现用不同的配置打开或者关闭这个AOP的功能。