apache / rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
https://rocketmq.apache.org/
Apache License 2.0
21.28k stars 11.71k forks source link

RocketMQLocalTransactionListener checkLocalTransaction number of times #1896

Closed quqiangsheng closed 4 years ago

quqiangsheng commented 4 years ago

I hope to get the data of the number of times the transaction is backchecked when the transaction is backchecked, so as to facilitate the subsequent judgment. For example, when the transaction is backchecked more than three times, the transaction is rolled back and logged.

quqiangsheng commented 4 years ago

I found a solution i use rocketmq-spring-boot-starter.version 2.1.0 when implement RocketMQLocalTransactionListener checkLocalTransaction(Message msg) method String checkTimes = (String) msg.getHeaders().get(MessageConst.PROPERTY_TRANSACTION_CHECK_TIMES); if use rocketmq-client I think it's easier