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 |
|---|---|
|
|
Retrieve a stored value by key; result goes to body or a header |
|
|
Store a value by key |
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
String |
— |
Required. Key name in the config store |
|
|
String |
— |
Value to store ( |
|
|
String |
— |
Pricefx connection name (uses default if omitted) |
|
|
String |
— |
Write result to this header instead of body ( |
|
|
String |
— |
Fallback if the key does not exist ( |
Examples
Store last export timestamp
<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&defaultValue=2000-01-01T00:00:00&toHeader=lastExportedAt"/>
<!-- Fetch records updated since last run -->
<to uri="pfx-api:fetch?objectType=P&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&value=${header.now}"/>
</route>
</routes>
Read a config value into body
<to uri="pfx-config:get?name=myKey&defaultValue=default"/>
<log message="Config value: ${body}"/>
Common Pitfalls
-
nameis required for bothgetandset— omitting it throws a configuration error. -
For
set, pass the value via thevalueURI parameter or set the body before the call (body takes precedence). -
Config values are stored per Pricefx partition — they are not shared across partitions.