1autodidact commented on issue #3930:
URL: https://github.com/apache/rocketmq/issues/3930#issuecomment-1229394562

   I encountered a similar problem and solved it with my own exploration
   
   ### Environment
   ```
    <dependency>
               <groupId>org.apache.rocketmq</groupId>
               <artifactId>rocketmq-spring-boot-starter</artifactId>
               <version>2.2.1</version>
   </dependency
   
    <dependency
               <groupId>org.apache.rocketmq</groupId>
               <artifactId>rocketmq-spring-boot-starter</artifactId>
               <version>2.1.1</version>
   </dependency>
   ```
   ### code
   ```
   rocketMQTemplate.sendAndReceive(MQTopic.QUESTION_TOPIC,question, new 
RocketMQLocalRequestCallback() {
               @Override
               public void onSuccess(Object message) {
                   log.error("消息发送成功" + JSONObject.toJSONString(message));
               }
   
               @Override
               public void onException(Throwable e) {
                   log.error("消息发送失败",e);
   
               }
           });
   ```
   
   ```
   @Component
   @RocketMQMessageListener(topic = "question_topic",consumerGroup = 
"question_consumer")
   @Slf4j
   public class QuestionConsumer implements RocketMQReplyListener<Question, 
Question> {
       @Resource
       QuestionMapper questionMapper;
       @Autowired
       private RocketMQTemplate rocketMQTemplate;
       @Override
       public Question onMessage(Question message) {
           questionMapper.insert(message);
           log.error( "线程名称:{}" +"message 
{}",Thread.currentThread().getName(),JSONObject.toJSONString(message));
           return message;
       }
   }
   ```
   
   ### Solved Problem
   rocketmq-spring-boot-starter version is okay for both 2.11 and 2.21
   
   **The most important thing is that the installed version of rocketmq needs 
to be 4.7.1 (linux install the 4.7.1 version of rockemq
   )**
   
![image](https://user-images.githubusercontent.com/41795715/187061535-8da0b4df-bff8-4e04-bfe6-9ddc5441d5c7.png)
   
   I use docker to install docker pull apache/rocketmq:4.7.1
   After adjusting the version of the docketmq installation, the cluster 
attribute is the brokerClusterName configuration in broker.conf
   
   ### How to use docker install rocketmq?
   (https://www.cnblogs.com/d1012181765/p/15603378.html)
   
   ### conclusion
   rockemq package version is the most import
   @ToDropBombs @RongtongJin @duhenglucky 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to