You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Th...@telekom.de on 2019/12/17 13:13:42 UTC

ExchangeHelper::getOriginalInMessage

Hi, 

looking at ExchangeHelper::getOriginalInMessage in case of exceptionhandling and useOriginalMessage() 
it seems that only the direct parent is used.
But the original input (GenericFileMessage) is parent of parent of parent. 
I could patch the getOriginalInMessage in that way it goes through to the top parent, but I think there must be a better solution.
What? 

Thomas 


ExchangeHelper::getOriginalInMessage
------------------------------------------------------

public static Message getOriginalInMessage(Exchange exchange) {
        Message answer = null;

        // try parent first
        UnitOfWork uow = exchange.getProperty(Exchange.PARENT_UNIT_OF_WORK, UnitOfWork.class);
        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;
    }