lilinjiang opened a new pull request, #639:
URL: https://github.com/apache/rocketmq-spring/pull/639

   ## What is the purpose of the change
   
   fix and close [ISSUE #632  ]
   
   fix v5 client [ISSUE #632  ]
   
   ## Brief changelog
   
   问题现象:
     
修复应用启动时,监听RocketMQ消息后使用@ExtRocketMQTemplateConfiguration注解扩展的RocketMQTemplate发送消息导致的空指针异常问题。
   问题原因:
     Listener 启动时机比 
@ExtRocketMQTemplateConfiguration注解扩展的RocketMQTemplate中producer 
实例化的早,导致Listener监听到消息时 RocketMQTemplate中producerBuilder 
还未实例化,使用RocketMQTemplate 发送消息将调用 getProducer() 方法获取  producer [  this.producer 
=  producerBuilder.build() ],此时producerBuilder 等于null 将导致空指针异常。
   
   (@RocketMQMessageListener 与 Spring Cloud Stream 
的生产者一起使用时同样存在一样的问题,都是因为Listener的启动时机太早)
   解决方案:
   推迟了Listener 的启动时机 详情见commits。
   
   


-- 
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