Name

Poll Enrich — Enriches messages with data retrieved from a polling consumer

Usage

The poll enrich pattern uses a polling consumer to pull data from an endpoint outside of the route and uses the new data to enrich the message being processed by the route. An AggregationStrategy is used to determine how the data is combined.

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

The Poll Enrich pattern is typically used to poll files from an FTP server.

Properties

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

Table 78. Poll Enrich Properties

NameDescription
LanguageSpecifies the expression that computes the endpoint URI to use as a resource endpoint to enrich from.
Aggregate On Exception

Specifies whether users can control how to handle exceptions thrown during the aggregate method (for example, whether to suppress the exception, set a custom message body, or something else).

The default is Disabled, which prevents use of the aggregate method when an exception occurs while attempting to retrieve the data to enrich from the resource.

Cache SizeSpecifies the maximum size used to cache and reuse the producer when URIs are reused.
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.
Id

Specifies a unique identifier for the endpoint.

The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id.

You can use the id to refer to endpoints in your Camel XML file.

Ignore Invalid EndpointWhen selected ignores the invalid endpoint exception when that endpoint is used to create a producer.
Strategy Method Allow NullSpecifies whether the aggregate method is used when there is no data to enrich, When disabled, it is not used. When enabled, null values are used as the oldExchange when POJOs are used as the AggregationStrategy. The default is Disabled
Strategy Method NameSpecifies the method name to use when POJOs are used as the AggregationStrategy.
Strategy RefSpecifies a reference for looking up the AggregationStrategy in the registry.
TimeoutSpecifies the time, in milliseconds, the enricher polls for data before timing out. An negative value specifies that the enricher will never timeout.