public class Enricher
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.Processor
producer
and second by aggregating input data and additional data. Aggregation of
input data and additional data is delegated to an AggregationStrategy
object. Aggregation of input data and additional data is delegated to an
AggregationStrategy
object.Constructor and Description |
---|
Enricher(org.apache.camel.processor.aggregate.AggregationStrategy aggregationStrategy,
org.apache.camel.Producer producer)
Creates a new
Enricher . |
Enricher(org.apache.camel.Producer producer)
Creates a new
Enricher . |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
void |
process(org.apache.camel.Exchange exchange)
Enriches the input data (
exchange ) by first obtaining
additional data from an endpoint represented by an endpoint
producer and second by aggregating input data and additional
data. |
void |
setAggregationStrategy(org.apache.camel.processor.aggregate.AggregationStrategy aggregationStrategy)
Sets the aggregation strategy for this enricher.
|
void |
setDefaultAggregationStrategy()
Sets the default aggregation strategy for this enricher.
|
public Enricher(org.apache.camel.Producer producer)
Enricher
. The implicit aggregation strategy is to
copy the additional data obtained from the enricher's resource over the
input data. When using the copy aggregation strategy the enricher
degenerates to a normal transformer.producer
- producer to resource endpoint.public Enricher(org.apache.camel.processor.aggregate.AggregationStrategy aggregationStrategy, org.apache.camel.Producer producer)
Enricher
.aggregationStrategy
- aggregation strategy to aggregate input data and additional
data.producer
- producer to resource endpoint.public void setAggregationStrategy(org.apache.camel.processor.aggregate.AggregationStrategy aggregationStrategy)
aggregationStrategy
- the aggregationStrategy to setpublic void setDefaultAggregationStrategy()
public void process(org.apache.camel.Exchange exchange) throws Exception
exchange
) by first obtaining
additional data from an endpoint represented by an endpoint
producer
and second by aggregating input data and additional
data. Aggregation of input data and additional data is delegated to an
AggregationStrategy
object set at construction time. If the
message exchange with the resource endpoint fails then no aggregation
will be done and the failed exchange content is copied over to the
original message exchange.process
in interface org.apache.camel.Processor
exchange
- input data.Exception
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
Copyright © 2018 Open eHealth Foundation. All rights reserved.