You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/11/28 11:06:37 UTC

[jira] Created: (CAMEL-3372) file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures

file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures
--------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-3372
                 URL: https://issues.apache.org/jira/browse/CAMEL-3372
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.5.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
            Priority: Minor
             Fix For: 2.6.0


See nabble
http://camel.465427.n5.nabble.com/onCompletion-for-failed-exchanges-tp3281388p3281388.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3372) file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures

Posted by "Bengt Rodehav (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964644#action_12964644 ] 

Bengt Rodehav commented on CAMEL-3372:
--------------------------------------

I had a hunch that there was a reason for setting the exchange as handled - now we know.

Will the property Exchange.EXCHANGE_CAUGHT always have a value if the exchange has failed? In other words, will the following code always work?
\\
\\
{code}
Exception cause = theExchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
boolean failed = theExchange.isFailed() || (cause != null);
{code}
\\
My current workaround is to set a custom property in my onException handler. I then check that property in onCompletion to see if the exchange has previously failed. Can I use the EXCEPTION_ CAUGHT property instead?


> file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3372
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3372
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.6.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/onCompletion-for-failed-exchanges-tp3281388p3281388.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3372) file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964648#action_12964648 ] 

Claus Ibsen commented on CAMEL-3372:
------------------------------------

Yes

Or you can use
{code}
onCompletion.onFailureOnly().process(new MyFailureProcessor()).end();
{code}

Then that will only run if the exchange failed.

> file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3372
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3372
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.6.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/onCompletion-for-failed-exchanges-tp3281388p3281388.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3372) file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures

Posted by "Bengt Rodehav (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-3372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12964651#action_12964651 ] 

Bengt Rodehav commented on CAMEL-3372:
--------------------------------------

OK - thanks a lot,

/Bengt

> file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3372
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3372
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.6.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/onCompletion-for-failed-exchanges-tp3281388p3281388.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-3372) file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-3372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3372.
--------------------------------

    Resolution: Not A Problem

As OnCompletion is another route it has to remove the caused exception, otherwise Camel think there is an exception thrown during routing and will have its error handler react to that as well.

You can grab the caused exception from the exchange property
{code}
Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
{code}

> file component - onMoveFailed - should keep the exchange marked as failed, so onCompletion etc can react on failures
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3372
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3372
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.6.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/onCompletion-for-failed-exchanges-tp3281388p3281388.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.