Alaske commented on code in PR #10548:
URL: https://github.com/apache/rocketmq/pull/10548#discussion_r3480195571


##########
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:
   
   Runtime-wise, the override is not strictly required because `MQProducer` 
already provides the same default implementation.
   
   I kept it in `DefaultMQProducer` for two reasons:
   
   1. To keep the transactional-send rejection explicit and consistent with the 
existing `sendMessageInTransaction(Message, Object)` method in 
`DefaultMQProducer`.
   2. To make the public API change visible in `DefaultMQProducer.schema`. The 
current schema tool collects declared methods from the class/superclasses, but 
does not include interface default methods.
   
   If you prefer to avoid the duplicated override, I can remove it and adjust 
the schema expectation accordingly.



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