Overview
The pfx-info component publishes log messages and events at configurable severity levels. Unlike the Camel <log> step (which writes to the SLF4J logger), pfx-info also routes messages through the IM EventPublisher, making them visible in PlatformManager monitoring.
URI pattern: pfx-info:level[?options]
Methods
|
Method |
Description |
|---|---|
|
|
Publish a DEBUG-level message |
|
|
Publish an INFO-level message |
|
|
Publish a WARN-level message |
|
|
Publish an ERROR-level message |
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
String |
— |
Message text to publish. Supports Simple expressions ( |
|
|
String |
— |
Event type label for categorisation in the event stream |
Examples
Log a progress message
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="importProducts">
<from uri="file:{{inbound.path}}"/>
<to uri="pfx-info:info?message=Starting product import for file ${header.CamelFileName}"/>
<to uri="pfx-csv:unmarshal?delimiter=,"/>
<to uri="pfx-api:loaddata?objectType=P&mapper=productMapper"/>
<to uri="pfx-info:info?message=Product import complete"/>
</route>
</routes>
Publish a typed error event
<onException>
<exception>java.lang.Exception</exception>
<to uri="pfx-info:error?message=Import failed: ${exception.message}&type=IMPORT_ERROR"/>
<handled><constant>true</constant></handled>
</onException>
Warn when no records found
<choice>
<when>
<simple>${body.size()} == 0</simple>
<to uri="pfx-info:warn?message=No records returned by filter — check filter criteria&type=EMPTY_RESULT"/>
</when>
</choice>
Common Pitfalls
-
pfx-infodoes not replace<log>for local console/file logging — use both if you need output in application logs AND in the PlatformManager event stream. -
Messages are published asynchronously through the event system; do not rely on ordering relative to subsequent route steps.
-
The
messageparameter supports Simple language expressions but does NOT support Groovy.