dongeforever commented on a change in pull request #398: [ISSUE #395]Resolve
compatibility issues and keep consistent with the old API
URL: https://github.com/apache/rocketmq/pull/398#discussion_r210177281
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
##########
@@ -264,12 +280,20 @@ public void checkTransactionState(final String addr,
final MessageExt msg,
@Override
public void run() {
- TransactionListener transactionCheckListener =
DefaultMQProducerImpl.this.checkListener();
- if (transactionCheckListener != null) {
+ TransactionCheckListener transactionCheckListener =
DefaultMQProducerImpl.this.checkListener();
+ TransactionListener transactionListener = getCheckListener();
+ if (transactionCheckListener != null || transactionListener !=
null) {
LocalTransactionState localTransactionState =
LocalTransactionState.UNKNOW;
Throwable exception = null;
try {
- localTransactionState =
transactionCheckListener.checkLocalTransaction(message);
+ if (transactionCheckListener != null) {
+ localTransactionState =
transactionCheckListener.checkLocalTransactionState(message);
+ } else if (transactionListener != null) {
+ log.info("Used new check API in transaction
message");
Review comment:
Better to use log.debug,otherwise it may cause too much log info
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services