Name

Enrich — Enriches a message with data from a secondary resource

Usage

The Enrich pattern uses a producer to pull data from an endpoint outside of the route and uses it to enrich the message the route is processing. An AggregationStrategy is used to determine how the data is combined.

The Enrich pattern can be used anywhere in the body of a route.

The Enrich pattern is typically used with request-response messaging; for example, to enrich the current message with the reply from a web service call.

[Tip]Tip

Use the Poll Enrich pattern when enriching files because the Enrich pattern will write the message content as a file.

Properties

Table 49 describes the properties you can specify using the properties editor.

Table 49. Enrich Properties

NameDescription
Resource UriSpecifies the URI of the endpoint from which the enrichment data is pulled.
Aggregation Strategy Method Allow NullSpecifies whether the aggregate method is used when there is no data to enrich. If disabled, it is not used. If enabled, null values are used as the oldExchange when POJOs are used as the AggregationStrategy.
Aggregation Strategy Method NameSpecifies the method name to use when POJOs are used as the AggregationStrategy.
Aggregation Strategy RefSpecifies a reference for looking up the AggregationStrategy in the registry.
Inherit Error HandlerSpecifies whether the node should use the error handler configured for the route. The default is Disabled.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
DescriptionSpecifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.