title: RocketMQ Consumer await for result callback
body: <p>I am using RocketMQ and want to get Message from Queue every new request</p>
  
  <pre><code>@Service
  public class GetMessageFromQueue extends BaseObject {
  @Resource
  private RocketMQTemplate rocketMQTemplate;
  
  @Value("${demo.rocketmq.topic}")
  private String springTopic;
  
  private String ms;
  
  public void getMessage(InternalRequest internalRequest) throws MyExeption {
      logger.info("sending message='{}'", inputData.getData());
  
      CountDownLatch loginLatch = new CountDownLatch (1);
      DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(inputData.getCorrID());
      consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
      try {
          //get message by TAG to filter only messsage I want
          consumer.subscribe(springTopic, inputData.getCorrID());
          consumer.registerMessageListener(new MessageListenerConcurrently() {
              @Override
              public ConsumeConcurrentlyStatus consumeMessage(List&lt;MessageExt&gt; msgs, ConsumeConcurrentlyContext context) {
                  logger.info("consumeMessage " + msgs.size());
                  for (MessageExt messageExt : msgs) {
                      logger.info("consumeMessage " + new String(messageExt.getBody()));
                      ms = new String(messageExt.getBody());
                  }
                  loginLatch.countDown ();
                  return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
              }
          });
          consumer.start();
      } catch (MQClientException e) {
          e.printStackTrace();
          logger.error("e " + e);
      }
  
      try {
          loginLatch.await ();
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
      consumer.shutdown();
  
      logger.info("ms " + ms);
      if(!inputData.getCorrID().equals(ms)) {
          throw new MyExeption ("500",ms,ms);
      }
      logger.info("get done " + ms);
  }
  }
  </code></pre>
  
  <p>This code work fine in normal case.
  But if I run many concurrent thread, some time the ms varrable don't get exactly the value come from MessageListenerConcurrently callback.</p>
  
  <p>Where I gent wrong?
  How can I waiting for result come from consumer here?</p>