This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new bab70a39d4e8 Remove deprecated use of PARENT_UNIT_OF_WORK that are no 
longer in use
bab70a39d4e8 is described below

commit bab70a39d4e8f2d5f5ec0cfa852340a2a609601c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Feb 13 15:44:57 2026 +0100

    Remove deprecated use of PARENT_UNIT_OF_WORK that are no longer in use
---
 .../src/main/java/org/apache/camel/ExchangePropertyKey.java   |  1 +
 .../main/java/org/apache/camel/support/ExchangeHelper.java    | 11 ++---------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git 
a/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java 
b/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java
index 5bf9e15a53bb..3c75d3794e4b 100644
--- a/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java
+++ b/core/camel-api/src/main/java/org/apache/camel/ExchangePropertyKey.java
@@ -69,6 +69,7 @@ public enum ExchangePropertyKey {
     MULTICAST_INDEX(Exchange.MULTICAST_INDEX),
     ON_COMPLETION(Exchange.ON_COMPLETION),
     ON_COMPLETION_ROUTE_IDS(Exchange.ON_COMPLETION_ROUTE_IDS),
+    @Deprecated(since = "4.14.0")
     PARENT_UNIT_OF_WORK(Exchange.PARENT_UNIT_OF_WORK),
     RECEIVED_TIMESTAMP(Exchange.RECEIVED_TIMESTAMP),
     RECIPIENT_LIST_ENDPOINT(Exchange.RECIPIENT_LIST_ENDPOINT),
diff --git 
a/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java 
b/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java
index 81c0f466b153..0fe62aac3359 100644
--- 
a/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java
+++ 
b/core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java
@@ -893,18 +893,11 @@ public final class ExchangeHelper {
     public static Message getOriginalInMessage(Exchange exchange) {
         Message answer = null;
 
-        // try parent first
-        UnitOfWork uow = 
exchange.getProperty(ExchangePropertyKey.PARENT_UNIT_OF_WORK, UnitOfWork.class);
+        UnitOfWork uow = exchange.getUnitOfWork();
         if (uow != null) {
             answer = uow.getOriginalInMessage();
         }
-        // fallback to the current exchange
-        if (answer == null) {
-            uow = exchange.getUnitOfWork();
-            if (uow != null) {
-                answer = uow.getOriginalInMessage();
-            }
-        }
+
         return answer;
     }
 

Reply via email to