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 2011/06/18 17:55:47 UTC

[jira] [Created] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
------------------------------------------------------------------------------------------------------

                 Key: CAMEL-4117
                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.7.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.8.0, 2.9.0


When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.

We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen updated CAMEL-4117:
-------------------------------

    Attachment: CAMEL-4117.patch

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>         Attachments: CAMEL-4117.patch
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen updated CAMEL-4117:
-------------------------------

    Attachment:     (was: CAMEL-4117.patch)

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen resolved CAMEL-4117.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.9.0)

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0
>
>         Attachments: CAMEL-4117.patch
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen updated CAMEL-4117:
-------------------------------

    Attachment: CAMEL-4117.patch

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>         Attachments: CAMEL-4117.patch
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen updated CAMEL-4117:
-------------------------------

    Attachment:     (was: CAMEL-4117.patch)

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>         Attachments: CAMEL-4117.patch
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen updated CAMEL-4117:
-------------------------------

    Attachment: CAMEL-4117.patch

Work in progress patch

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>         Attachments: CAMEL-4117.patch
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4117) RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor

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

Claus Ibsen commented on CAMEL-4117:
------------------------------------

For example in the given route below. You would like the Exchange to be the *same* for each of the redeliveries. Even if you alter the Exchange in the .process code, and then *afterwards* and exception is thrown

{code}

                // try to redeliver up till 3 times
                errorHandler(defaultErrorHandler().maximumRedeliveries(3).redeliveryDelay(0));

                from("direct:a")
                    .process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            // should be same input body
                            assertEquals("Hello World", exchange.getIn().getBody());
                            assertFalse("Should not have OUT", exchange.hasOut());
                            assertNull(exchange.getException());
                          
                            // mutate IN body
                            exchange.getIn().setBody("Bye World");

                            counter++;
                            throw new IllegalArgumentException("Forced");
                        }
                    });
{code}

So in this example you would expect that each redelivery contains the message body "Hello World" despite you changed it in the .process code.

> RedeliverErrorHandler - Should make defensive copy of Exchange so redelivery works for using Processor
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4117
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4117
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0, 2.9.0
>
>
> When using redelivery with the Camel error handler, it will by default use the _previous_ exchange when redelivering. This ensures that any changes that was done by the failed attempt does not reflect when a redelivery is performed (eg think like use original message). However this does not apply when end users uses the low level .process in their Camel routes. So if they change the Exchange in the .process and then some error occurs, then that change is redelivered.
> We should consider making the redelivery error handler do a defensive copy of the exchange, so it can redelivery without any changes/side effects. For example this happens when people use .bean or any of the other EIPs. So why not for .process as well?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira