How to specify the method to call for an AggregationStrategy

Six Stars

How to specify the method to call for an AggregationStrategy

Hi there,

 

I'm using various enterprise integration patterns that support exchange aggregation within Talend routes (e.g. Content-Enricher, Aggregator, Recipient-List and so on) and am able to create a bean that implements the AggregationStrategy interface just fine.

 

However, I was wondering how I would go about implementing a bean where I define multiple aggregate methods (with custom names) within the same bean. The use-case here is that I need to aggregate multiple times within a route and having to create separate beans each time is a bit silly. According to the documentation for poll enrich for example, I should be able somehow define a parameter called strategyMethodName to specify the aggregation strategy method name to use.

 

The problem is, I can't figure out how to do this in Talend as the Aggregation Strategy field in the cContentEnricher Talend component for example is hard-coded to create a new instance of my bean so I can't so something like:

...
.pollEnrich(
    "file:path/to/file/?fileName=some.file",
    3000,
    AggregationStrategies.bean(
        new beans.CustomAggregation(), "myCustomAggregationMethodName"
    )
)
...

Reference documentation for the AggregationStrategies.bean method here.

 

Does anyone know how to call a custom method name for aggregation in Talend? Maybe using cBean or cBeanRegister? I'm using Talend ESB 6.4.1

 

Thanks!


Accepted Solutions
Six Stars

Re: How to specify the method to call for an AggregationStrategy

Ended up going with a cJavaDSLProcessor and implementing it myself. Not pretty, but it works.


All Replies
Six Stars

Re: How to specify the method to call for an AggregationStrategy

Bumpity-bump.
Six Stars

Re: How to specify the method to call for an AggregationStrategy

Ended up going with a cJavaDSLProcessor and implementing it myself. Not pretty, but it works.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download