pfx-event:fetch
Allows you to download events from Pricefx and process them. You can use pfx-event:fetch
in multiple routes and consume different events per route.
Properties
Option | Type | Default | Description |
---|---|---|---|
| integer | 1000 | Defines the maximum number of events to download from the server in one server call. |
| string | Â | Defines the Pricefx client name (which must be defined in the Spring context as a bean). |
| string | gson | Defines the JSON parser used to parse an event message. Possible values: gson, jackson. |
| object | Â | Defines event types downloaded from the Pricefx server. |
| string | event | Defines an archive folder for a processed event. If a route fails, events will be in archiveFolder. If it is successful, they will be in {archiveFolder}/error. |
Scheduling Properties (Inherited)
Option | Type | Default | Description |
---|---|---|---|
| integer | 500 | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds) and 1h (1 hour). |
| integer | 1000 | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds), 5m30s (5 minutes and 30 seconds) and 1h (1 hour). |
| Boolean | true | Controls if a fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details. |
| integer | Â | Lets the scheduled polling consumer back off if there was a number of subsequent idles/errors in a row. The multiplier is the number of polls that will be skipped before the next actual attempt happens again. When this option is in use, |
| integer | Â | Sets the number of subsequent error polls (failed due to an error) that should happen before |
| integer | Â | The number of subsequent idle polls that should happen before |
| object | MILLISECONDS | Time unit for the Possible values: NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS. |
| object | none | Enables a Cron scheduler from either the camel-spring or camel-quartz2 component. Possible values: none, spring, quartz2. |
| Boolean | true | Determines whether the scheduler should be auto-started. |
| object | Â | Configures additional properties when using a custom scheduler or any of the Quartz2 Spring based schedulers. |
| object | Â | Allows configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. |
| object | Â | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling, usually occurred during the poll operation before an exchange was created and routed in Camel. |
| Boolean | false | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. |
| Boolean | false | If enabled, ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages. |
| object | Â | Lets the consumer use a custom ExceptionHandler. If the |
| object | TRACE | Determines the logging level. The consumer logs a start/complete log line when it polls. Possible values: TRACE, DEBUG, INFO, WARN, ERROR, OFF. |
Consumer Properties (Inherited)
Option | Type | Default | Description |
---|---|---|---|
| Boolean | false | Sets whether only synchronous processing should be used or whether Camel is allowed to use asynchronous processing (if supported). |
| Boolean | false | Allows bridging the consumer to the Camel routing Error Handler. This means that any exception occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at the WARN or ERROR levels and ignored. |
| object | Â | Sets the exchange pattern when the consumer creates an exchange. Possible values: InOnly, RobustInOnly, InOut, InOptionalOut, OutOnly, RobustOutOnly, OutIn, OutOptionalIn. |
Examples
Download events of given type:
<route id="${placeholder}">
<from uri="pfx-event:fetch?delay={{integration.sap.s4.rebates.period}}000&maxEvents=1000&eventTypes=ITEM_APPROVED_RBA&archiveFolder={{archive.folder}}"/>
<log message="Received event ITEM_APPROVED_RBA with data ${body}" loggingLevel="INFO"/>
<setHeader name="typedId">
<groovy>request.body.data.typedId.first()</groovy>
</setHeader>
<setHeader name="RBAuniqueName">
<groovy>request.body.data.uniqueName.first()</groovy>
</setHeader>
<log message="Fetching RR for RBA ${header[RBAuniqueName]} (${header[typedId]})" loggingLevel="INFO" />
</route>
IntegrationManager version 5.8.0