pfx-config Component

Overview

The pfx-config component reads and writes persistent key-value configuration using an advanced configuration repository backed by Pricefx. Use it to store incremental export timestamps, last-run state, or any other values that must survive route restarts.

URI pattern: pfx-config:method[?options]


Methods

Method

Description

get

Retrieve a stored value by key; result goes to body or a header

set

Store a value by key


Parameters

Parameter

Type

Default

Description

name

String

Required. Key name in the config store

value

String

Value to store (set only)

connection

String

Pricefx connection name (uses default if omitted)

toHeader

String

Write result to this header instead of body (get only)

defaultValue

String

Fallback if the key does not exist (get only)


Examples

Store last export timestamp

XML
<routes xmlns="http://camel.apache.org/schema/spring">
    <route id="exportAndTrack">
        <from uri="timer://export?repeatCount=1"/>

        <!-- Read last exported timestamp -->
        <to uri="pfx-config:get?name=lastExportedAt&amp;defaultValue=2000-01-01T00:00:00&amp;toHeader=lastExportedAt"/>

        <!-- Fetch records updated since last run -->
        <to uri="pfx-api:fetch?objectType=P&amp;filter=deltaFilter"/>
        <to uri="pfx-csv:marshal"/>
        <to uri="file:{{outbound.path}}?fileName=products-${date:now:yyyyMMdd}.csv"/>

        <!-- Save new timestamp -->
        <setHeader name="now">
            <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss}</simple>
        </setHeader>
        <to uri="pfx-config:set?name=lastExportedAt&amp;value=${header.now}"/>
    </route>
</routes>

Read a config value into body

XML
<to uri="pfx-config:get?name=myKey&amp;defaultValue=default"/>
<log message="Config value: ${body}"/>

Common Pitfalls

  • name is required for both get and set — omitting it throws a configuration error.

  • For set, pass the value via the value URI parameter or set the body before the call (body takes precedence).

  • Config values are stored per Pricefx partition — they are not shared across partitions.