We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found a bug, not just asking a question, which should be created in GitHub Discussions.
I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Windows10
RocketMQ version5.0
jdk1.8
rocketmq-spring-boot-starter 调整广播模式无法接收消息。只有集群模式才能接收到消息。 因为是旧的项目我只能使用springboot2.1.x。
import lombok.extern.slf4j.Slf4j; import org.apache.rocketmq.spring.annotation.MessageModel; import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; import org.apache.rocketmq.spring.annotation.SelectorType; import org.apache.rocketmq.spring.core.RocketMQListener; import org.springframework.stereotype.Service; /** * @author yujikuan * @Classname SyncBookMqService * @Description 同步培优服务务 * @Date 2024/12/10 15:59 */ @Service @Slf4j @RocketMQMessageListener(topic = "nrms_qg_normal_topic", consumerGroup = "nrms_qg_group", accessKey = "${rocketmq.default.username}", secretKey = "${rocketmq.default.password}", selectorType = SelectorType.TAG // ,messageModel = MessageModel.BROADCASTING ) //接收消息 public class SyncBookMqService implements RocketMQListener<String> { @Override public void onMessage(String s) { log.info("接收到同步数据库消息:{}", s); } } //发送消息 @GetMapping("send2") public ResponseEntity<ResponseWrapper> send2(String message) { log.info("message={}",message); org.springframework.messaging.Message msg = MessageBuilder.withPayload("rsend2 message " + message).build(); String topic="nrms_qg_normal_topic"; String tagId="syncBookDBOutputTag"; rocketmqTemplate.send(topic +":"+tagId, msg); return WrapResponseMapper.ok(); }
配置
rocketmq: name-server: ${rocketmq.default.address} producer: # 发送消息超时时间,默认3000 sendMessageTimeout: 10000 # 发送消息失败重试次数,默认2 retryTimesWhenSendFailed: 2 # 异步消息重试此处,默认2 retryTimesWhenSendAsyncFailed: 2 # 消息最大长度,默认1024 * 1024 * 4(默认4M) maxMessageSize: 40960 # 压缩消息阈值,默认4k(1024 * 4) compressMessageBodyThreshold: 4096 # 是否在内部发送失败时重试另一个broker,默认false retryNextServer: true access-key: ${rocketmq.default.username} secret-key: ${rocketmq.default.password} group: qqrms-res-producer-group 依赖
<dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-spring-boot-starter</artifactId> <version>2.1.1</version> <!--<exclusions> <exclusion> <artifactId>rocketmq-client</artifactId> <groupId>org.apache.rocketmq</groupId> </exclusion> <exclusion> <artifactId>rocketmq-common</artifactId> <groupId>org.apache.rocketmq</groupId> </exclusion> <exclusion> <artifactId>rocketmq-logging</artifactId> <groupId>org.apache.rocketmq</groupId> </exclusion> <exclusion> <artifactId>rocketmq-remoting</artifactId> <groupId>org.apache.rocketmq</groupId> </exclusion> </exclusions>--> </dependency>
能够每一个服务实例都收到消息。
No response
The text was updated successfully, but these errors were encountered:
Setting the messageModel as MessageModel.BROADCASTING
messageModel
MessageModel.BROADCASTING
Sorry, something went wrong.
No branches or pull requests
Before Creating the Bug Report
I found a bug, not just asking a question, which should be created in GitHub Discussions.
I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
Windows10
RocketMQ version
RocketMQ version5.0
JDK Version
jdk1.8
Describe the Bug
rocketmq-spring-boot-starter 调整广播模式无法接收消息。只有集群模式才能接收到消息。
因为是旧的项目我只能使用springboot2.1.x。
Steps to Reproduce
配置
What Did You Expect to See?
能够每一个服务实例都收到消息。
What Did You See Instead?
能够每一个服务实例都收到消息。
Additional Context
No response
The text was updated successfully, but these errors were encountered: