yx9o commented on code in PR #10548:
URL: https://github.com/apache/rocketmq/pull/10548#discussion_r3485060386
##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -950,6 +950,27 @@ public TransactionSendResult
sendMessageInTransaction(Message msg,
throw new RuntimeException("sendMessageInTransaction not implement,
please use TransactionMQProducer class");
}
+ /**
+ * This method is used to send transactional messages with a message queue
selector.
+ *
+ * <p>The {@code selectorArg} is passed only to {@link
MessageQueueSelector#select(List, Message, Object)}.
+ * The {@code transactionArg} is passed only to {@link
TransactionListener#executeLocalTransaction(Message, Object)}.
+ * This method follows the existing selector send semantics and does not
perform the broker or queue reselection
+ * retry used by the default send path.</p>
+ *
+ * @param msg Transactional message to send.
+ * @param selector Message queue selector.
+ * @param selectorArg Argument used by the selector.
+ * @param transactionArg Argument used along with local transaction
executor.
+ * @return Transaction result.
+ * @throws MQClientException if there is any client error.
+ */
+ @Override
+ public TransactionSendResult sendMessageInTransaction(Message msg,
Review Comment:
Thanks for the explanation. I think we should keep the style consistent. If
we prefer to explicitly implement this method in DefaultMQProducer, should we
avoid making it a default method in MQProducer and keep it consistent with the
other interface methods?
--
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]