You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claudio Corsi (JIRA)" <ji...@apache.org> on 2012/09/07 22:38:07 UTC

[jira] [Created] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

Claudio Corsi created CAMEL-5579:
------------------------------------

             Summary: Add an abstract grouped by aggregator strategy that users can extend from.
                 Key: CAMEL-5579
                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Claudio Corsi
            Priority: Minor
             Fix For: 2.11.0


The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  

What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.

What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.

I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claus Ibsen resolved CAMEL-5579.
--------------------------------

    Resolution: Fixed

Added a little sample on the aggregate eip wiki page
                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, grouped-aggregate-strategy.tar.gz, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claus Ibsen reassigned CAMEL-5579:
----------------------------------

    Assignee: Claus Ibsen
    
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claudio Corsi commented on CAMEL-5579:
--------------------------------------

Ah, I see why you are skeptical in accepting this solution.  I understand discouraging users from even using this strategy.  I was not saying that this addition should be on top of the current one but more like enhancing the current implementation such that if there are users that would like to use this feature then they just sub-class the GroupedExchangeStrategy base class instead of copying it and then making changes to it.  This will at least reduce the possibility of users incorrectly applying this strategy.  

You can then still discourage users from using this feature by including that warning within the class javadoc.

                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claus Ibsen commented on CAMEL-5579:
------------------------------------

I have improved the code a bit which allows to transfer the completion from the exchange property to the message body. This makes it even easier to do aggregation strategies where you want to build together a List<V>. This is IMHO better than the exchange property where the grouped exchanges is stored by default in the old logic.
                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, grouped-aggregate-strategy.tar.gz, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claudio Corsi updated CAMEL-5579:
---------------------------------

    Attachment: GroupedByExchangeAggregationStrategy.java
                AbstractGroupedByValueAggregationStrategy.java

Here are the sources that implements this improvement to the grouped by aggregation strategy approach.  This will then simplify the task of implementing a grouped by aggregation strategy by extending this class instead and not having the re-implement what the default grouped by process already does.

I have also include an example of extending this class so that it does the same thing as the already existing grouped by exchange aggregation strategy class.

                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claudio Corsi updated CAMEL-5579:
---------------------------------

    Attachment: grouped-aggregate-strategy.tar.gz

Hi Andreas,

Here is a project that includes an example of how to use this feature that I was suggesting.  Keep in mind that this update will probably not be included with the distribution since this is not encouraged.

Regards,

--Claudio

                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, grouped-aggregate-strategy.tar.gz, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Andreas Kuhtz commented on CAMEL-5579:
--------------------------------------

Hi Claudio,
Do you have a unit test that shows the usage?
                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claudio Corsi updated CAMEL-5579:
---------------------------------

    Patch Info: Patch Available
    
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CAMEL-5579) Add an abstract grouped by aggregator strategy that users can extend from.

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

Claus Ibsen commented on CAMEL-5579:
------------------------------------

The GroupedExchangeAggregationStrategy is not a strategy that we encourage end users to use. I dont think we should add more classes to the core.
                
> Add an abstract grouped by aggregator strategy that users can extend from.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5579
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5579
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claudio Corsi
>            Priority: Minor
>              Labels: camel-core,
>             Fix For: 2.11.0
>
>         Attachments: AbstractGroupedByValueAggregationStrategy.java, GroupedByExchangeAggregationStrategy.java
>
>
> The current GroupedExchangeAggregationStrategy will combine a list of exchange instances for a given correlation expression and propagate the exchange with that list.   This is great as long as users are content with processing the list of exchanges.  
> What about users that would like to extract data from the exchange and add that to the forwarded list?  This is something that require users to create their own strategy.
> What I propose is that we provide base class for users to extend such that it manages the grouped list and have the user state and return the type of instances that will be added to the grouped list.
> I will attach a base class that users can extend and an example of a sub-classed version that will return a list of exchange instances like the default GroupedExchangeAggregateStrategy camel core class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira