You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Alan Foster (JIRA)" <ji...@apache.org> on 2012/09/04 20:43:12 UTC

[jira] [Created] (CAMEL-5567) Add Multiple correlation Ids to the Aggregator component

Alan Foster created CAMEL-5567:
----------------------------------

             Summary: Add Multiple correlation Ids to the Aggregator component
                 Key: CAMEL-5567
                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
             Project: Camel
          Issue Type: Improvement
            Reporter: Alan Foster


Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation

It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive

For instance it may look like 

{code}
<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:start"/>
      
        <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
            <correlationExpression>
                <!-- If this xpath returns nothing try the next expression etc -->
                <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
                <xpath>/FooResponse/Id/text()</xpath>
                <xpath>/CorrelationKey/text()</simple>
            </correlationExpression>
            <to uri="mock:aggregated"/>
        </aggregate>
    </route>
</camelContext>
{code}

I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it

Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Claus Ibsen commented on CAMEL-5567:
------------------------------------

Alan

First of all XML is not a programming language, and we have to avoid bloating the DSLs.

What you talk about is already possible in a programming language such as Java, where you can combine expressions/predicates into compounds.
There is an ExpressionBuilder / PredicateBuilder with and|or constructs.

And if you are a XPath/XQuery ninja, you could most likely construct a single expression that has compound xpaths build in etc.

Also you have to think about consistency. All the EIPs and whatnot in the DSL have building blocks such as of a Predicate | Expression you can use to configure them with. So we cannot do something "special" for the aggregator etc.

Also its a bit hard to do a compound expression in XML language, as what does that mean exactly? Some maybe want all the expressions to be build together (AND), and others may want only the first which has a not null value (eg OR) as you. And others a combination of them. And then it gets tough to express such use-cases in a XML file. XML is after all not a programming language with powerful control flows and constructs.


                
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Alan Foster updated CAMEL-5567:
-------------------------------

    Description: 
Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation

It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive

For instance it may look like 

{code}
<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:start"/>
      
        <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
            <correlationExpression>
                <!-- If this xpath returns nothing try the next expression etc -->
                <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
                <xpath>/FooResponse/Id/text()</xpath>
                <xpath>/CorrelationKey/text()</xpath>
            </correlationExpression>
            <to uri="mock:aggregated"/>
        </aggregate>
    </route>
</camelContext>
{code}

I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it

Alan

  was:
Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation

It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive

For instance it may look like 

{code}
<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:start"/>
      
        <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
            <correlationExpression>
                <!-- If this xpath returns nothing try the next expression etc -->
                <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
                <xpath>/FooResponse/Id/text()</xpath>
                <xpath>/CorrelationKey/text()</simple>
            </correlationExpression>
            <to uri="mock:aggregated"/>
        </aggregate>
    </route>
</camelContext>
{code}

I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it

Alan

    
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Hadrian Zbarcea commented on CAMEL-5567:
----------------------------------------

But that would still be one expression, albeit a composite one, isn't it?
                
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Alan Foster commented on CAMEL-5567:
------------------------------------

@Hadrian Yes you're right, I've shown multiple xpath expressions which you could of course combine into one xpath.

But the intentions are that you can use any of the pluggable expression languages in a row ie

{code}
<correlationExpression>
    <!-- Try header first -->
    <header>foo</xpath>

    <!-- If this xpath returns nothing try the next expression -->
    <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>

    <!-- Default to an Unknown constant correlation id -->
    <constant>Unknown</xpath>
</correlationExpression>
{code}

This could be very powerful/useful to add I feel

What are your opinions on this Hadrian? :)
                
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Claus Ibsen commented on CAMEL-5567:
------------------------------------

Also we have a ticket reported by Christian S. about supporting nested expressions, as his use-case was to use nested expressions as parameter bindings to a method call expressions. This ticket is AFAIR currently scheduled for Camel 3.0.

Something a like:
{code:xml}
<method ref="myBean" method="myMethod">
  <compoundExpression>
    <header>foo</header>
    <xpath>/foo/bla</xpath>
    <constant>true</constant>
  </compundExpression>
</method>
{code}

So there is some synergy to this one. But we have to be careful adding this to the DSL to avoid bloat.
Also the DSL in Camel 2.x should be kept stable etc.
                
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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-5567) Add Multiple correlation Ids to the Aggregator component

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

Claus Ibsen commented on CAMEL-5567:
------------------------------------

Alan, do you have a real-life use-case for this need? 

And frankly you can do this in Java code, and use a method call expression to setup in the XML DSL.


                
> Add Multiple correlation Ids to the Aggregator component
> --------------------------------------------------------
>
>                 Key: CAMEL-5567
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5567
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Alan Foster
>
> Currently the aggregator component allows users to specifiy one expression that they would like to use for aggregation
> It would be nice to add many different correlation expressions for all of the different payload contents that an aggregator can receive
> For instance it may look like 
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <route>
>         <from uri="direct:start"/>
>       
>         <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
>             <correlationExpression>
>                 <!-- If this xpath returns nothing try the next expression etc -->
>                 <xpath>/AcmeServiceResponse/CorrelationId/text()</xpath>
>                 <xpath>/FooResponse/Id/text()</xpath>
>                 <xpath>/CorrelationKey/text()</xpath>
>             </correlationExpression>
>             <to uri="mock:aggregated"/>
>         </aggregate>
>     </route>
> </camelContext>
> {code}
> I wonder what your thoughts are on this suggestion? If it seems like a good idea I can start to make a patch for it
> Alan

--
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