You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2025/12/14 10:15:19 UTC

[PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Aias00 opened a new pull request, #7860:
URL: https://github.com/apache/incubator-seata/pull/7860

   
   <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements.  See the NOTICE file distributed with
       this work for additional information regarding copyright ownership.
       The ASF licenses this file to You under the Apache License, Version 2.0
       (the "License"); you may not use this file except in compliance with
       the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
       
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
   -->
   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
   - [x] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ### Ⅰ. Describe what this PR did
   Disallow messages with delay time levels in Seata transactions and add a corresponding test.
   
   ### Ⅱ. Does this pull request fix one issue?
   <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
   fixes #7351 
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)? 
   
   
   ### Ⅳ. Describe how to verify it
   
   
   ### Ⅴ. Special notes for reviews
   
   


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "lokidundun (via GitHub)" <gi...@apache.org>.
lokidundun commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618005222


##########
changes/zh-cn/2.x.md:
##########
@@ -56,6 +56,7 @@
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] 修复 Consul 监听器空值 NPE 问题
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] 解决TransactionAutoConfiguration与Spring Boot 4.x的兼容性问题
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] 修复package.json中min-document的逗号缺失
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] 修复 RocketMQ 事务中延迟消息静默失效的问题,改为显式抛出异常

Review Comment:
   ditto



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2616902212


##########
extensions/messaging/seata-rocketmq/src/test/java/org/apache/seata/integration/rocketmq/SeataMQProducerTest.java:
##########
@@ -361,6 +361,18 @@ void testDoSendMessageInTransactionWithTransactionId() throws Exception {
         verify(seataMQProducer).superSend(msg, timeout);
     }
 
+    @Test
+    void testDoSendMessageInTransactionWithDelayLevel() {
+        Message msg = new Message("testTopic", "testBody".getBytes());
+        msg.setDelayTimeLevel(1);
+        long timeout = 3000L;
+        String xid = "testXid";
+        long branchId = 123L;
+
+        assertThrows(
+                MQClientException.class, () -> seataMQProducer.doSendMessageInTransaction(msg, timeout, xid, branchId));

Review Comment:
   The test should verify the exception message to ensure the correct error is being thrown. Consider capturing the thrown exception and asserting that its message matches "Message delay time level is not supported in Seata transaction". This would make the test more robust and ensure the error message provides clear feedback to users.



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#issuecomment-3650698317

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/7860?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 70.93%. Comparing base ([`1b2a486`](https://app.codecov.io/gh/apache/incubator-seata/commit/1b2a4860b5404e01e599486b400e8a4eadaf02a1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d0370a4`](https://app.codecov.io/gh/apache/incubator-seata/commit/d0370a4a38aad1ca659ebf2abe8434c9b0e5f9af?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##                2.x    #7860      +/-   ##
   ============================================
   + Coverage     70.90%   70.93%   +0.02%     
     Complexity      992      992              
   ============================================
     Files          1322     1322              
     Lines         50322    50322              
     Branches       5946     5946              
   ============================================
   + Hits          35683    35698      +15     
   + Misses        11693    11679      -14     
   + Partials       2946     2945       -1     
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7860?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...he/seata/integration/rocketmq/SeataMQProducer.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7860?src=pr&el=tree&filepath=extensions%2Fmessaging%2Fseata-rocketmq%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fintegration%2Frocketmq%2FSeataMQProducer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZW5zaW9ucy9tZXNzYWdpbmcvc2VhdGEtcm9ja2V0bXEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlYXRhL2ludGVncmF0aW9uL3JvY2tldG1xL1NlYXRhTVFQcm9kdWNlci5qYXZh) | `89.47% <100.00%> (+3.50%)` | :arrow_up: |
   
   ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/7860/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/7860/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/7860?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618017728


##########
changes/en-us/2.x.md:
##########
@@ -137,6 +138,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7808](https://github.com/apache/incubator-seata/pull/7808)] Deflake multiple Insert Executor tests by fixing order-dependent primary key (PK) value comparison
 - [[#7815](https://github.com/apache/incubator-seata/pull/7815)] test: fix combine test to avoid failure due to ordering
 - [[#7827](https://github.com/apache/incubator-seata/pull/7827)] Fix non-deteriministic in TableMetaTest#testGetPrimaryKeyOnlyName
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] Add unit test for delayed message validation in RocketMQ transaction

Review Comment:
   done



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "lokidundun (via GitHub)" <gi...@apache.org>.
lokidundun commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618004591


##########
changes/en-us/2.x.md:
##########
@@ -56,6 +56,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] fix the NPE on ConsulConfigurationTest method
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] resolve TransactionAutoConfiguration compatibility with Spring Boot 4.x
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] fix comma missing in package.json/min-document
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] Fix the issue where delayed messages in RocketMQ transactions were silently ignored, now explicitly throwing an exception

Review Comment:
   This pr address is wrong, maybe it is 7860



##########
changes/en-us/2.x.md:
##########
@@ -137,6 +138,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7808](https://github.com/apache/incubator-seata/pull/7808)] Deflake multiple Insert Executor tests by fixing order-dependent primary key (PK) value comparison
 - [[#7815](https://github.com/apache/incubator-seata/pull/7815)] test: fix combine test to avoid failure due to ordering
 - [[#7827](https://github.com/apache/incubator-seata/pull/7827)] Fix non-deteriministic in TableMetaTest#testGetPrimaryKeyOnlyName
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] Add unit test for delayed message validation in RocketMQ transaction

Review Comment:
   This log maybe should be removed.



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "lokidundun (via GitHub)" <gi...@apache.org>.
lokidundun commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618335598


##########
changes/zh-cn/2.x.md:
##########
@@ -56,6 +56,7 @@
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] 修复 Consul 监听器空值 NPE 问题
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] 解决TransactionAutoConfiguration与Spring Boot 4.x的兼容性问题
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] 修复package.json中min-document的逗号缺失
+- [[#7351](https://github.com/apache/incubator-seata/pull/7860)] 修复 RocketMQ 事务中延迟消息静默失效的问题,改为显式抛出异常

Review Comment:
   ditto



##########
changes/en-us/2.x.md:
##########
@@ -56,6 +56,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] fix the NPE on ConsulConfigurationTest method
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] resolve TransactionAutoConfiguration compatibility with Spring Boot 4.x
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] fix comma missing in package.json/min-document
+- [[#7351](https://github.com/apache/incubator-seata/pull/7860)] Fix the issue where delayed messages in RocketMQ transactions were silently ignored, now explicitly throwing an exception

Review Comment:
   It seems it's still a little wrong and your Github ID should also be registered.



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618014515


##########
changes/en-us/2.x.md:
##########
@@ -56,6 +56,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] fix the NPE on ConsulConfigurationTest method
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] resolve TransactionAutoConfiguration compatibility with Spring Boot 4.x
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] fix comma missing in package.json/min-document
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] Fix the issue where delayed messages in RocketMQ transactions were silently ignored, now explicitly throwing an exception

Review Comment:
   sorry i made a mistake, i put issue link here



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "maple525866 (via GitHub)" <gi...@apache.org>.
maple525866 commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618456102


##########
changes/en-us/2.x.md:
##########


Review Comment:
   If you haven't registered your ID yet, please register here.



##########
changes/zh-cn/2.x.md:
##########


Review Comment:
   ditto



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618464495


##########
changes/en-us/2.x.md:
##########


Review Comment:
   oh, thx



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618415087


##########
changes/en-us/2.x.md:
##########
@@ -56,6 +56,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7796](https://github.com/apache/incubator-seata/pull/7796)] fix the NPE on ConsulConfigurationTest method
 - [[#7839](https://github.com/apache/incubator-seata/pull/7839)] resolve TransactionAutoConfiguration compatibility with Spring Boot 4.x
 - [[#7855](https://github.com/apache/incubator-seata/pull/7855)] fix comma missing in package.json/min-document
+- [[#7351](https://github.com/apache/incubator-seata/pull/7860)] Fix the issue where delayed messages in RocketMQ transactions were silently ignored, now explicitly throwing an exception

Review Comment:
   hi, i have changed the number 7351 to 7860, but i do not understand what`s wrong with my Github ID



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feat: Disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "lokidundun (via GitHub)" <gi...@apache.org>.
lokidundun commented on code in PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860#discussion_r2618005524


##########
changes/zh-cn/2.x.md:
##########
@@ -136,6 +137,7 @@
 - [[#7808](https://github.com/apache/incubator-seata/pull/7808)] 修复多个 Insert Executor 单测中因主键值比较顺序导致的间歇性失败问题
 - [[#7815](https://github.com/apache/incubator-seata/pull/7815)] 通过合并测试来修复,避免因执行顺序导致的失败
 - [[#7827](https://github.com/apache/incubator-seata/pull/7827)] 修复 TableMetaTest 中因主键名称列表顺序不稳定导致的单测间歇性失败问题
+- [[#7351](https://github.com/apache/incubator-seata/issues/7351)] 增加 RocketMQ 事务中延迟消息校验的单元测试

Review Comment:
   ditto



-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] optimize: disallow messages with delay time levels in Seata transactions and add a corresponding test. [incubator-seata]

Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #7860:
URL: https://github.com/apache/incubator-seata/pull/7860


-- 
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: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org