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/09/14 13:39:40 UTC

[jira] Created: (CAMEL-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

Splitter EIP - The sub exchanges should not contains on completions from original Exchange
------------------------------------------------------------------------------------------

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


See nabble
http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.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-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Simon commented on CAMEL-3121:
------------------------------

The following post contains 2 problems :

Issue 1:
Cannot rename the file exception. It was found and fixed there:
https://issues.apache.org/activemq/browse/CAMEL-2897
But  the problem only fix when streaming is used. If streaming isn't used... the problem persist. 
Quick patch: 
Splitter.java 
private Iterable<ProcessorExchangePair> createProcessorExchangePairsList( 
                        Exchange exchange, Object value) { 
                List<ProcessorExchangePair> result; 
                Integer collectionSize = CollectionHelper.size(value); 
                if (collectionSize != null) { 
                        result = new ArrayList<ProcessorExchangePair>(collectionSize); 
                } else { 
                        result = new ArrayList<ProcessorExchangePair>(); 
                } 
                Iterable<ProcessorExchangePair> createProcessorExchangePairsIterable = createProcessorExchangePairsIterable( 
                                exchange, value); 
                Iterator<ProcessorExchangePair> iterator = createProcessorExchangePairsIterable 
                                .iterator(); 
                while (iterator.hasNext()) { 
                        ProcessorExchangePair next = iterator.next(); 
                        result.add(next); 
                } 
                return result; 
        } 


Issue 2:
We found a problem of shutdown in the patch we submitted. Now we do not create a DefaultUNitOfWork we only set it at null.

Quick patch: 
public Object next() { 
        Object part = iterator.next(); 
        Exchange newExchange = exchange.copy(); 
                if (iterator.hasNext()) { 
                        newExchange.setUnitOfWork(null); 
                        }                        if (part instanceof Message) { 
                                                        newExchange.setIn((Message) part); 
                                                } else { 
                                                        Message in = newExchange.getIn(); 
                                                        in.setBody(part); 
                                                } 
                                                return createProcessorExchangePair(index++, 
                                                                getProcessors().iterator().next(), newExchange); 
                                        } 



> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.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-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Claus Ibsen commented on CAMEL-3121:
------------------------------------

Added unit test to trunk: 996857.

Cannot re produce the error on trunk. 

> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.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-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Claus Ibsen resolved CAMEL-3121.
--------------------------------

    Resolution: Fixed

I fixed some stuff on file commit stuff due another ticket, so this bug should be resolved as well.

> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.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-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Claus Ibsen commented on CAMEL-3121:
------------------------------------

Thanks Simon, I have fixed the windows issue. trunk: 997217

> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.html

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


[jira] Issue Comment Edited: (CAMEL-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Claus Ibsen edited comment on CAMEL-3121 at 9/15/10 3:06 AM:
-------------------------------------------------------------

Hi Claus,

We are still able to reproduce it with 2.5.0. (both problems)

Did you try it on Windows ?

Issue 1:
{code}
from("file:e:/test/camel").split(body().tokenize(",")).process(new Processor() {
        @Override
        public void process(Exchange arg0) throws Exception {
                Thread.sleep(2000);
        }
}); 
{code}

It looks like the testcase you`ve done for FileSplitStreamingWithChoiceTest.java except you need to remove streaming.
Quick patch: Splitter.java

{code}
private Iterable<ProcessorExchangePair> createProcessorExchangePairsList(
                        Exchange exchange, Object value) {
                List<ProcessorExchangePair> result;
                Integer collectionSize = CollectionHelper.size(value);
                if (collectionSize != null) {
                        result = new ArrayList<ProcessorExchangePair>(collectionSize);
                } else {
                        result = new ArrayList<ProcessorExchangePair>();
                }
                Iterable<ProcessorExchangePair> createProcessorExchangePairsIterable = createProcessorExchangePairsIterable(
                                exchange, value);
                Iterator<ProcessorExchangePair> iterator = createProcessorExchangePairsIterable
                                .iterator();
                while (iterator.hasNext()) {
                        ProcessorExchangePair next = iterator.next();
                        result.add(next);
                }
                return result;
        } 
{code}

Issue 2
Quick Patch:

{code}
public Object next() {
        Object part = iterator.next();
        Exchange newExchange = exchange.copy();
                if (iterator.hasNext()) {
                        newExchange.setUnitOfWork(null);
                        }                        if (part instanceof Message) {
                                                        newExchange.setIn((Message) part);
                                                } else {
                                                        Message in = newExchange.getIn();
                                                        in.setBody(part);
                                                }
                                                return createProcessorExchangePair(index++,
                                                                getProcessors().iterator().next(), newExchange);
                                        }
:
{code}

      was (Author: smcduff@hotmail.com):
    Hi Claus,

We are still able to reproduce it with 2.5.0. (both problems)

Did you try it on Windows ?

Issue 1:
from("file:e:/test/camel").split(body().tokenize(",")).process(new Processor() {
        @Override
        public void process(Exchange arg0) throws Exception {
                Thread.sleep(2000);
        }
}); 
It looks like the testcase you`ve done for FileSplitStreamingWithChoiceTest.java except you need to remove streaming.
Quick patch:
Splitter.java
private Iterable<ProcessorExchangePair> createProcessorExchangePairsList(
                        Exchange exchange, Object value) {
                List<ProcessorExchangePair> result;
                Integer collectionSize = CollectionHelper.size(value);
                if (collectionSize != null) {
                        result = new ArrayList<ProcessorExchangePair>(collectionSize);
                } else {
                        result = new ArrayList<ProcessorExchangePair>();
                }
                Iterable<ProcessorExchangePair> createProcessorExchangePairsIterable = createProcessorExchangePairsIterable(
                                exchange, value);
                Iterator<ProcessorExchangePair> iterator = createProcessorExchangePairsIterable
                                .iterator();
                while (iterator.hasNext()) {
                        ProcessorExchangePair next = iterator.next();
                        result.add(next);
                }
                return result;
        } 


Issue 2

Quick Patch:
public Object next() {
        Object part = iterator.next();
        Exchange newExchange = exchange.copy();
                if (iterator.hasNext()) {
                        newExchange.setUnitOfWork(null);
                        }                        if (part instanceof Message) {
                                                        newExchange.setIn((Message) part);
                                                } else {
                                                        Message in = newExchange.getIn();
                                                        in.setBody(part);
                                                }
                                                return createProcessorExchangePair(index++,
                                                                getProcessors().iterator().next(), newExchange);
                                        }
:
  
> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.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-3121) Splitter EIP - The sub exchanges should not contains on completions from original Exchange

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

Simon commented on CAMEL-3121:
------------------------------

Hi Claus,

We are still able to reproduce it with 2.5.0. (both problems)

Did you try it on Windows ?

Issue 1:
from("file:e:/test/camel").split(body().tokenize(",")).process(new Processor() {
        @Override
        public void process(Exchange arg0) throws Exception {
                Thread.sleep(2000);
        }
}); 
It looks like the testcase you`ve done for FileSplitStreamingWithChoiceTest.java except you need to remove streaming.
Quick patch:
Splitter.java
private Iterable<ProcessorExchangePair> createProcessorExchangePairsList(
                        Exchange exchange, Object value) {
                List<ProcessorExchangePair> result;
                Integer collectionSize = CollectionHelper.size(value);
                if (collectionSize != null) {
                        result = new ArrayList<ProcessorExchangePair>(collectionSize);
                } else {
                        result = new ArrayList<ProcessorExchangePair>();
                }
                Iterable<ProcessorExchangePair> createProcessorExchangePairsIterable = createProcessorExchangePairsIterable(
                                exchange, value);
                Iterator<ProcessorExchangePair> iterator = createProcessorExchangePairsIterable
                                .iterator();
                while (iterator.hasNext()) {
                        ProcessorExchangePair next = iterator.next();
                        result.add(next);
                }
                return result;
        } 


Issue 2

Quick Patch:
public Object next() {
        Object part = iterator.next();
        Exchange newExchange = exchange.copy();
                if (iterator.hasNext()) {
                        newExchange.setUnitOfWork(null);
                        }                        if (part instanceof Message) {
                                                        newExchange.setIn((Message) part);
                                                } else {
                                                        Message in = newExchange.getIn();
                                                        in.setBody(part);
                                                }
                                                return createProcessorExchangePair(index++,
                                                                getProcessors().iterator().next(), newExchange);
                                        }
:

> Splitter EIP - The sub exchanges should not contains on completions from original Exchange
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3121
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3121
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Camel-calling-commit-too-early-when-using-split-seda-file-endpoint-tp2830894p2830894.html

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