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

Option

Type

Default

Description

maxEvents

integer

1000

Defines the maximum number of events to download from the server in one server call.

connection

string

 

Defines the Pricefx client name (which must be defined in the Spring context as a bean).

jsonParser

string

gson

Defines the JSON parser used to parse an event message.

Possible values: gson, jackson. 

eventTypes

object

 

Defines event types downloaded from the Pricefx server.

archiveFolder

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

Option

Type

Default

Description

delay

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

initialDelay

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

useFixedDelay

Boolean

true

Controls if a fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.

backoffMultiplier

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, backoffIdleThreshold and/or backoffErrorThreshold must also be configured.

backoffErrorThreshold

integer

 

Sets the number of subsequent error polls (failed due to an error) that should happen before backoffMultipler should kick in.

backoffIdleThreshold

integer

 

The number of subsequent idle polls that should happen before backoffMultipler should kick in.

timeUnit

object

MILLISECONDS

Time unit for the initialDelay and delay options.

Possible values: NANOSECONDS, MICROSECONDS, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS.

scheduler

object

none

Enables a Cron scheduler from either the camel-spring or camel-quartz2 component.

Possible values: none, spring, quartz2. 

startScheduler

Boolean

true

Determines whether the scheduler should be auto-started.

schedulerProperties

object

 

Configures additional properties when using a custom scheduler or any of the Quartz2 Spring based schedulers.

scheduledExecutorService

object

 

Allows configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.

pollStrategy

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.

sendEmptyMessageWhenIdle

Boolean

false

If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.

greedy

Boolean

false

If enabled, ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.

exceptionHandler

object

 

Lets the consumer use a custom ExceptionHandler. If the bridgeErrorHandler option is enabled, this options is not in use. By default the consumer will deal with exceptions that will be logged at the WARN or ERROR levels and ignored.

runLoggingLevel

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

Option

Type

Default

Description

synchronous

Boolean

false

Sets whether only synchronous processing should be used or whether Camel is allowed to use asynchronous processing (if supported).

bridgeErrorHandler

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.

exchangePattern

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&amp;maxEvents=1000&amp;eventTypes=ITEM_APPROVED_RBA&amp;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