Overview
The pfx-messaging component publishes messages to the Integration Manager internal RabbitMQ exchange with an embedded, bounded exponential retry. Use it wherever a route or kamelet must deliver a message reliably even when the broker is briefly unreachable — the retry logic lives inside the component, so the route stays a single declarative line instead of hand-rolled retry loops.
The message is delivered through the worker's standard event-publishing infrastructure (the same auto-reconnecting connection used for internal IM events), under the routing key you configure. The exchange body is sent as-is and must be a non-empty string (typically pre-serialized JSON).
URI pattern: pfx-messaging:method[?options]
Methods
|
Method |
Description |
|---|---|
|
|
Publish the exchange body under the configured routing key, retrying on failure |
The component is producer-only — it cannot be used in from.
Parameters
|
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
String |
— |
Required. Routing key the message is published under on the IM internal RabbitMQ exchange |
|
|
int |
|
Maximum delivery attempts, including the first one. Must be at least 1 |
|
|
long |
|
Base delay in milliseconds between delivery attempts |
|
|
boolean |
|
When |
|
|
long |
|
Upper bound in milliseconds for the exponential backoff delay |
Retry behavior
-
With the defaults (
retries=3,retryDelayMs=5000,exponentialBackoff=true), a failing publish is attempted at 0s, +5s, and +10s before giving up. -
When all attempts are exhausted, the exchange fails with the last publish error — the calling route decides what happens next (error handler,
doTry/doCatch,onCompletion). -
Deterministic errors fail fast without consuming the retry budget: an empty or missing exchange body is rejected immediately, and an invalid endpoint configuration (
routingKeymissing,retriesbelow 1) fails at route startup.
Examples
Publish a completion event with default retry
<setBody>
<groovy>groovy.json.JsonOutput.toJson([type: "integration-finished", integrationId: "abc"])</groovy>
</setBody>
<to uri="pfx-messaging:send?routingKey=im-internal.im-iaas.events.internal.IntegrationFinished"/>
Survive a longer broker outage
<to uri="pfx-messaging:send?routingKey=im-internal.im-iaas.events.external.DataExportWorkloadExecutionResult&retries=5"/>
Fixed delay between attempts
<to uri="pfx-messaging:send?routingKey=a.b.c&retries=4&retryDelayMs=2000&exponentialBackoff=false"/>
Common Pitfalls
-
The exchange body must be a non-empty string — serialize your payload (e.g. with
JsonOutput.toJson) before callingsend; an empty body fails immediately without any delivery attempt. -
retriescounts total attempts, not additional retries:retries=1means a single attempt with no retry. -
Retry delays block the calling route thread — keep
retries/maxRetryDelayMsproportionate for routes with high concurrency. -
Event publishing must be enabled (
integration.event-driven.enabled=true, the default for IaaS workers); with messaging disabled the message is silently discarded by the no-op publisher (a warning is logged at startup). -
The routing key is used verbatim —
integration.event-driven.im-publisher.output-routing-key-prefixis intentionally not applied topfx-messagingsends, so a prefix configured for platform events cannot reroute your message.