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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read