FAQ
Hello.
First of all thanks for the great framework.

My question is this:
After reading all this posts about transactions I understand that it is
backing system's responsibility to handle redeliveries.
But what if I just want send a copy of a message to an endpoint everytime a
redelivery occurs?
To be more specific here is a snippet:

from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

Now I want to let backing system do its work on redelivery and delays but I
want to get notified every time an exception occurs, for example to send to
an endpoint or a queue a copy of the message that was "inside" processor
when exception fired. How could i do this?

Thanks a lot,
Bill
--
View this message in context: http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21024810.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Claus Ibsen at Dec 16, 2008 at 5:02 am
    Hi

    The error handler stuff is not to easy to spot in the wiki:
    http://activemq.apache.org/camel/error-handler.html

    Using the exception clause:
    http://activemq.apache.org/camel/exception-clause.html

    Should let you be able to send a message somewhere when an exception is thrown

    onException(Exception.class).to("seda:damm")
    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Then when an exception occurs it's send to the seda queue damm and
    proceeded, and thus the backing system should get the exception as
    well and do it's rollback.

    But the seda queue is not part of the TX so the message should stay there.

    On Tue, Dec 16, 2008 at 1:08 AM, radisb wrote:

    Hello.
    First of all thanks for the great framework.

    My question is this:
    After reading all this posts about transactions I understand that it is
    backing system's responsibility to handle redeliveries.
    But what if I just want send a copy of a message to an endpoint everytime a
    redelivery occurs?
    To be more specific here is a snippet:

    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Now I want to let backing system do its work on redelivery and delays but I
    want to get notified every time an exception occurs, for example to send to
    an endpoint or a queue a copy of the message that was "inside" processor
    when exception fired. How could i do this?

    Thanks a lot,
    Bill
    --
    View this message in context: http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21024810.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --

    /Claus Ibsen
    Apache Camel Committer
    Blog: http://davsclaus.blogspot.com/
  • Radisb at Dec 16, 2008 at 8:37 pm
    Claus, this works only if I have not put policy in the route. I think it is
    due to the hidden feature of transactions with deadletter when policy is not
    put in the route. I ll search more.


    Claus Ibsen-2 wrote:
    Hi

    The error handler stuff is not to easy to spot in the wiki:
    http://activemq.apache.org/camel/error-handler.html

    Using the exception clause:
    http://activemq.apache.org/camel/exception-clause.html

    Should let you be able to send a message somewhere when an exception is
    thrown

    onException(Exception.class).to("seda:damm")
    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Then when an exception occurs it's send to the seda queue damm and
    proceeded, and thus the backing system should get the exception as
    well and do it's rollback.

    But the seda queue is not part of the TX so the message should stay there.

    On Tue, Dec 16, 2008 at 1:08 AM, radisb wrote:

    Hello.
    First of all thanks for the great framework.

    My question is this:
    After reading all this posts about transactions I understand that it is
    backing system's responsibility to handle redeliveries.
    But what if I just want send a copy of a message to an endpoint everytime
    a
    redelivery occurs?
    To be more specific here is a snippet:

    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Now I want to let backing system do its work on redelivery and delays but
    I
    want to get notified every time an exception occurs, for example to send
    to
    an endpoint or a queue a copy of the message that was "inside" processor
    when exception fired. How could i do this?

    Thanks a lot,
    Bill
    --
    View this message in context:
    http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21024810.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --

    /Claus Ibsen
    Apache Camel Committer
    Blog: http://davsclaus.blogspot.com/
    --
    View this message in context: http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21041271.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Claus Ibsen at Dec 17, 2008 at 4:57 am

    On Tue, Dec 16, 2008 at 9:37 PM, radisb wrote:
    Claus, this works only if I have not put policy in the route. I think it is
    due to the hidden feature of transactions with deadletter when policy is not
    put in the route. I ll search more.
    Yeah that is correct it's the DeadLetterChannel that handles the
    onException as well. So this is another use-case for supporting
    enabling DLC as a kind of orchestrator even for transacted exchanges.
    For instance the handled=true is thus not being able to kick in as
    well.

    Claus Ibsen-2 wrote:
    Hi

    The error handler stuff is not to easy to spot in the wiki:
    http://activemq.apache.org/camel/error-handler.html

    Using the exception clause:
    http://activemq.apache.org/camel/exception-clause.html

    Should let you be able to send a message somewhere when an exception is
    thrown

    onException(Exception.class).to("seda:damm")
    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Then when an exception occurs it's send to the seda queue damm and
    proceeded, and thus the backing system should get the exception as
    well and do it's rollback.

    But the seda queue is not part of the TX so the message should stay there.

    On Tue, Dec 16, 2008 at 1:08 AM, radisb wrote:

    Hello.
    First of all thanks for the great framework.

    My question is this:
    After reading all this posts about transactions I understand that it is
    backing system's responsibility to handle redeliveries.
    But what if I just want send a copy of a message to an endpoint everytime
    a
    redelivery occurs?
    To be more specific here is a snippet:

    from("transactedActiveMq:sourceQ").policy(ApropagationRequiredPolicy).process(AnExceptionThrowingProcessor);

    Now I want to let backing system do its work on redelivery and delays but
    I
    want to get notified every time an exception occurs, for example to send
    to
    an endpoint or a queue a copy of the message that was "inside" processor
    when exception fired. How could i do this?

    Thanks a lot,
    Bill
    --
    View this message in context:
    http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21024810.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --

    /Claus Ibsen
    Apache Camel Committer
    Blog: http://davsclaus.blogspot.com/
    --
    View this message in context: http://www.nabble.com/Cast-a-copy-message-to-an-endpoint-when-exception-is-thrown-tp21024810s22882p21041271.html
    Sent from the Camel - Users mailing list archive at Nabble.com.


    --

    /Claus Ibsen
    Apache Camel Committer
    Blog: http://davsclaus.blogspot.com/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedDec 16, '08 at 12:08a
activeDec 17, '08 at 4:57a
posts4
users2
websitecamel.apache.org

2 users in discussion

Claus Ibsen: 2 posts Radisb: 2 posts

People

Translate

site design / logo © 2022 Grokbase