pfx-info Component

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

debug

Publish a DEBUG-level message

info

Publish an INFO-level message

warn

Publish a WARN-level message

error

Publish an ERROR-level message


Parameters

Parameter

Type

Default

Description

message

String

Message text to publish. Supports Simple expressions (${header.name}, etc.)

type

String

Event type label for categorisation in the event stream


Examples

Log a progress message

XML
<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&amp;mapper=productMapper"/>
        <to uri="pfx-info:info?message=Product import complete"/>
    </route>
</routes>

Publish a typed error event

XML
<onException>
    <exception>java.lang.Exception</exception>
    <to uri="pfx-info:error?message=Import failed: ${exception.message}&amp;type=IMPORT_ERROR"/>
    <handled><constant>true</constant></handled>
</onException>

Warn when no records found

XML
<choice>
    <when>
        <simple>${body.size()} == 0</simple>
        <to uri="pfx-info:warn?message=No records returned by filter — check filter criteria&amp;type=EMPTY_RESULT"/>
    </when>
</choice>

Common Pitfalls

  • pfx-info does 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 message parameter supports Simple language expressions but does NOT support Groovy.