You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sambardar <sa...@yahoo.com> on 2012/04/01 21:50:11 UTC

Aggregation EIP

I am trying to use Multiple Aggregates on a single header wherein each of the
aggregate picks up different fields from a header to do the aggregation.
Once the aggregation is done and all are sent to the next component in the
route, is there a way to figure out what aggregate came from which header
evaluation. For example my route looks like. As you can see below i use
multiple aggregates. Each aggregate actually uses a different "POLICY" field
from the header. As these aggregates are sent to the next bean, how can i
differentiate which one came from which header combination.

<from uri =
"netty:tcp://localhost:1556?decoder=#xihMediationFrameDecoder&amp;sync=false"
/>
   				<process ref="perProcessor" />
		    	<to uri = "bean:perAdapterBean" />  
	  	    <aggregate strategyRef="policyUsageAggregate"
completionInterval="100000">
				<correlationExpression>
				
<simple>${in.headers.POLICYID_1}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
				</correlationExpression>
			 <to uri = "bean:kpiWriterBean" />
			</aggregate>
			<aggregate strategyRef="policyUsageAggregate"
completionInterval="100000">
				<correlationExpression>
				
<simple>${in.headers.POLICYID_2}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
				</correlationExpression>
			 <to uri = "bean:kpiWriterBean" />
			</aggregate>
			<aggregate strategyRef="policyUsageAggregate"
completionInterval="100000">
				<correlationExpression>
				
<simple>${in.headers.POLICYID_3}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
				</correlationExpression>
			 <to uri = "bean:kpiWriterBean" />
			</aggregate>

--
View this message in context: http://camel.465427.n5.nabble.com/Aggregation-EIP-tp5610860p5610860.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Aggregation EIP

Posted by boday <be...@initekconsulting.com>.
why not just lookup/use the "in.headers.POLICYID_X" property?  otherwise, you
can manually set another header property prior to calling the
"bean:kpiWriterBean" or even call a different method on the bean based on
the policy property (see recipient list pattern, etc)


sambardar wrote
> 
> I am trying to use Multiple Aggregates on a single header wherein each of
> the aggregate picks up different fields from a header to do the
> aggregation. Once the aggregation is done and all are sent to the next
> component in the route, is there a way to figure out what aggregate came
> from which header evaluation. For example my route looks like. As you can
> see below i use multiple aggregates. Each aggregate actually uses a
> different "POLICY" field from the header. As these aggregates are sent to
> the next bean, how can i differentiate which one came from which header
> combination.
> 
> <from uri =
> "netty:tcp://localhost:1556?decoder=#xihMediationFrameDecoder&amp;sync=false"
> />
>    				<process ref="perProcessor" />
> 		    	<to uri = "bean:perAdapterBean" />  
> 	  	    <aggregate strategyRef="policyUsageAggregate"
> completionInterval="100000">
> 				<correlationExpression>
> 				
> <simple>${in.headers.POLICYID_1}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
> 				</correlationExpression>
> 			 <to uri = "bean:kpiWriterBean" />
> 			</aggregate>
> 			<aggregate strategyRef="policyUsageAggregate"
> completionInterval="100000">
> 				<correlationExpression>
> 				
> <simple>${in.headers.POLICYID_2}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
> 				</correlationExpression>
> 			 <to uri = "bean:kpiWriterBean" />
> 			</aggregate>
> 			<aggregate strategyRef="policyUsageAggregate"
> completionInterval="100000">
> 				<correlationExpression>
> 				
> <simple>${in.headers.POLICYID_3}-${in.headers.Tier}-${in.headers.ENTITLEMENT_1}-${in.headers.ENTITLEMENT_2}-${in.headers.VERSION}-${in.headers.RAT_ID}</simple>
> 				</correlationExpression>
> 			 <to uri = "bean:kpiWriterBean" />
> 			</aggregate>
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/Aggregation-EIP-tp5610860p5611470.html
Sent from the Camel - Users mailing list archive at Nabble.com.