Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #3797] Improve DefaultMQProducerImpl code #3809

Merged
merged 3 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ public boolean isPublishTopicNeedUpdate(String topic) {
}

/**
* This method will be removed in the version 5.0.0 and <code>getCheckListener</code> is recommended.
*
* @return
* @deprecated This method will be removed in the version 5.0.0 and {@link DefaultMQProducerImpl#getCheckListener} is recommended.
*/
@Override
@Deprecated
Expand Down Expand Up @@ -326,11 +324,9 @@ public void run() {
try {
if (transactionCheckListener != null) {
localTransactionState = transactionCheckListener.checkLocalTransactionState(message);
} else if (transactionListener != null) {
} else {
log.debug("Used new check API in transaction message");
localTransactionState = transactionListener.checkLocalTransaction(message);
} else {
Kvicii marked this conversation as resolved.
Show resolved Hide resolved
log.warn("CheckTransactionState, pick transactionListener by group[{}] failed", group);
}
} catch (Throwable e) {
log.error("Broker call checkTransactionState, but checkLocalTransactionState exception", e);
Expand Down Expand Up @@ -485,6 +481,7 @@ public void send(Message msg,
}

/**
* @deprecated
* It will be removed at 4.4.0 cause for exception handling and the wrong Semantics of timeout. A new one will be
* provided in next version
*
Expand Down Expand Up @@ -1035,6 +1032,7 @@ public void send(Message msg, MessageQueue mq, SendCallback sendCallback)
}

/**
* @deprecated
* It will be removed at 4.4.0 cause for exception handling and the wrong Semantics of timeout. A new one will be
* provided in next version
*
Expand Down Expand Up @@ -1193,7 +1191,7 @@ public void run() {
sendSelectImpl(msg, selector, arg, CommunicationMode.ASYNC, sendCallback,
timeout - costTime);
} catch (MQBrokerException e) {
throw new MQClientException("unknownn exception", e);
throw new MQClientException("unknown exception", e);
}
} catch (Exception e) {
sendCallback.onException(e);
Expand All @@ -1205,7 +1203,7 @@ public void run() {

});
} catch (RejectedExecutionException e) {
throw new MQClientException("exector rejected ", e);
throw new MQClientException("executor rejected ", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.rocketmq.common.message.Message;

/**
* This interface will be removed in the version 5.0.0, interface {@link TransactionListener} is recommended.
* @deprecated This interface will be removed in the version 5.0.0, interface {@link TransactionListener} is recommended.
*/
@Deprecated
public interface LocalTransactionExecuter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
package org.apache.rocketmq.client.producer;

import org.apache.rocketmq.common.message.MessageExt;

/**
* This interface will be removed in the version 5.0.0, interface {@link TransactionListener} is recommended.
* @deprecated This interface will be removed in the version 5.0.0, interface {@link TransactionListener} is recommended.
*/
@Deprecated
public interface TransactionCheckListener {
Expand Down