Press "Enter" to skip to content

Retry Strategies in SAP Cloud Integration

0

Why retry design matters

A good retry strategy in SAP Cloud Integration retries transient errors automatically, stops quickly on permanent ones, and parks the rest in one shared place where they can be fixed in bulk. Getting there means balancing three goals that pull against each other:

  • Minimal human interaction. Every message an operator has to look at costs time. Ideally, only messages that truly need a decision ever reach a person.
  • Minimal messaging traffic. A message that retries forever against a dead receiver burns JMS transactions, worker threads, monitoring entries and log storage. The longer it runs, the more it hides real problems.
  • Minimal number of queues. JMS queues are a limited tenant resource. A design that needs one or two queues per interface does not scale beyond a few dozen scenarios.
 three competing goals · the naive fix for each hurts another 

The naive answer to each goal makes the others worse. Retrying forever saves human effort but floods the tenant. Dedicated retry and error queues per interface make operations easy but exhaust the queue budget. This post walks through the JMS retry mechanics, the patterns that resolve these conflicts, and how SAP’s pipeline concept bakes most of them in.


How JMS retry works in Cloud Integration

Out of the box, a JMS sender channel retries a failed message indefinitely; there is no setting for a maximum retry count. Everything else in this post builds on that fact.

The basic setup is two integration flows. The first receives the message and writes it to a queue via a JMS receiver channel. The second polls the queue via a JMS sender channel and delivers to the receiver. If the second flow ends in error, the message stays in the queue and goes into retry (SAP blog).

The JMS sender channel gives you these levers:

SettingWhat it doesRecommendation
Retry IntervalWait time before the first retry (default 1 min)1–5 min for most scenarios
Exponential BackoffDoubles the interval after each failed retryAlways on
Maximum Retry IntervalUpper bound for the doubled interval (default 60 min)60 min or more if the business allows
Dead-Letter QueueTakes a message out of processing if it crashed the worker node twice (typically out-of-memory)Always on; protects the tenant, not the receiver
Header SAPJMSRetriesRetry counter set by the adapter on every attemptUse it to cap retries yourself

Two details matter for the design. First, the configured interval is a minimum, not a promise: under load, retries can start much later than configured (KBA 3569999). Second, the Dead-Letter Queue checkbox is not a business dead letter queue. It only guards against poison messages that kill the runtime; a message failing with an HTTP 500 will still retry forever.

The documented way to stop after N attempts is an exception subprocess that reads SAPJMSRetries and decides whether to raise the error again (retry continues) or end the message (SAP blog, KBA 3147804).

Three anti-patterns to avoid

Most retry problems in productive tenants come from one of three designs, each optimizing one goal at the expense of the others.

Endless retries. The default configuration. A message with a mapping error or a rejected payload will never succeed, yet it retries every hour for weeks. Each attempt creates a failed message processing log, consumes a JMS transaction and hits the receiver. Multiply by a few thousand messages after a receiver outage and the queue monitor becomes unreadable.

One queue (or two) per interface. A dedicated processing queue plus a dedicated error queue per interface is easy to operate. It is also expensive. An Enterprise Edition tenant starts with 30 queues, 9 GB of storage and 150 transactions; self-service scaling goes up to 100 queues, and more needs SAP support (SAP Learning, SAP Community). With 2 queues per interface, the default budget is gone at 15 interfaces.

Manual-only error handling. Errors end up in the queue monitor or the message monitor, and someone checks them daily. Without classification, operators spend their time on messages that would have succeeded on the next retry, or that nobody can fix anyway.


Pattern 1: Bounded retries with exponential backoff

Cap every retry loop by time, not by gut feeling: pick the longest receiver outage you want to bridge automatically, and derive the retry count from it.

bounded retry loop · 1 decision, 1 loop 

Below the cap, the message rolls back and waits; at the cap, it is forwarded to parking and removed from the queue.

With a 1-minute interval, exponential backoff and a 60-minute maximum, the waits run 1, 2, 4, 8, 16, 32 minutes, then 60 minutes per attempt. The first 6 retries cover about one hour. To bridge a 24-hour outage you need roughly 6 + 23 = 29 retries; for a weekend, around 70. Traffic stays low because, after the first hour, each stuck message costs only one attempt per hour.

Implement the cap in the consuming flow:

  1. In the JMS sender channel, enable Exponential Backoff and set Retry Interval and Maximum Retry Interval.
  2. Set transaction handling to Required for JMS, so that forwarding to another queue and removing the message from the source queue commit together.
  3. Add an exception subprocess with a router on the retry counter, for example the condition ${header.SAPJMSRetries} >= 29.
  4. Below the limit, end with an Error End event. The transaction rolls back and the message stays in retry.
  5. At or above the limit, forward the message to the parking queue (Pattern 3), then end with a regular End event. The message leaves the source queue and stops consuming resources.

Make the limit an externalized parameter. Operations can then tune it per scenario without redeploying a changed flow.


Pattern 2: Classify errors before you retry

A retry only helps if the cause can go away by itself. Classifying the error in the exception subprocess removes most pointless traffic and most human work at the same time.

error classification · 4 handling paths 

One decision in the exception subprocess picks the path; only the transient path uses the full time-based retry budget.

The exception is available in the exchange property CamelExceptionCaught. For HTTP-based receivers, a short Groovy script can read the status code from the exception and set a property such as errorClass; the router then branches on that property together with SAPJMSRetries.

Error classTypical causesAction
TransientTimeouts, connection refused, HTTP 429, 502, 503, 504Retry with backoff up to the time-based cap
SystemicHTTP 401/403, expired certificate, wrong endpointKeep retrying slowly and alert once; fixing the configuration releases all messages without touching them
PermanentMapping or validation errors, HTTP 400, 422No retry; park immediately with the reason attached
UnknownHTTP 500, unclassified exceptionsShort retry budget (for example 3–5 attempts), then park

The systemic class is the one most designs miss. When a credential expires, every message of the interface fails. Parking them all creates hundreds of tickets; retrying them slowly while one alert goes out means one fix and zero manual restarts.


Pattern 3: One shared parking area instead of error queues per interface

Use a single parking area for all interfaces and make every parked message self-describing. That keeps the queue count flat and lets one generic process handle dead letters.

shared parking area · many interfaces, one place to act 

Every interface parks into the same place; the metadata headers tell operators or a restart flow where each message goes back to.

Before parking, the exception subprocess adds metadata as headers: source queue, interface ID, error class, error text (shortened), retry count and timestamp. With that, any operator or tool can tell what failed and where it must go back to, without opening the original flow.

There are two practical ways to build the parking area:

OptionHow it worksStrengthsLimits
Parking queue without consumerOne JMS queue that no flow polls; operators move messages back to the source queue from the queue monitorZero traffic while parked; uses one queue for the whole tenantRestart is manual; storage counts against the JMS quota
Data Store plus restart flowParked messages go to a Data Store with the interface ID as entry ID; a generic flow, triggered by HTTP or timer, re-sends them to the source queueRestart can be automated, for example after a systemic fix; uses no queue at allData Store entries expire; needs its own monitoring

Either way, human interaction shrinks to two cases: permanent errors that need a data fix, and systemic errors that need a configuration fix. Everything transient is handled before a message ever reaches the parking area.

Alert on the parking area, not on every failed attempt. One alert per interface and error class is enough; failed retry attempts in the message monitor are expected and should not page anyone.


Pattern 4: The pipeline concept

SAP’s pipeline concept applies Patterns 1 to 3 at tenant scale: a fixed handful of queues serves all asynchronous scenarios, retries are capped by default, and failed messages land in dead letter queues per pipeline step rather than per interface.

pipeline concept · 4 steps, 4 queues, 4 DLQs

Each step reads from its queue and writes to the next; a message that exceeds its retry maximum drops into that step’s DLQ, and is moved back to the same queue after the fix. With the integrated messaging runtime, the middle steps merge and the count halves.

The concept, published with the migration guide for SAP Process Orchestration, splits processing into generic integration flows that mirror the PI/PO pipeline: inbound processing, receiver determination, interface determination, outbound processing. The steps are decoupled by JMS queues. Scenario-specific behavior such as routing conditions, mappings and receiver endpoints comes from the Partner Directory and ProcessDirect calls, so new scenarios need no new queues (SAP blog).

Pipeline variantProcessing queuesRetry/dead letter queuesTotal
Standard pipeline448
Integrated messaging runtime (inbound conversion, receiver and interface determination in one step)224

Those numbers stay constant whether you run 20 scenarios or 2,000 (SAP Help).

How it addresses the three goals:

  • Traffic. The default maximum is 5 retries instead of unlimited. A scenario-specific maximum can be maintained in the Partner Directory (SAP blog). In the current v2 package, errors where a retry makes no sense skip retry and go straight to the dead letter queue (change log, SAP Business Accelerator Hub).
  • Human interaction. Only messages that exceeded their retry budget reach a dead letter queue. When a message is stored there, the reason is attached to the message processing log (SAP blog). After the cause is fixed, operators move it back to the step’s normal queue.
  • Queue count. Dead letter handling is per pipeline step, not per interface, so the error path costs the same 4 (or 2) queues for every scenario. Receiver-specific outbound queues are optional, for isolating a slow receiver from the others.

Two caveats. A shared queue means a misbehaving scenario can delay others in the same step; receiver-specific outbound queues are the escape hatch. And restarts are still manual queue moves, so the systemic-error case from Pattern 2 needs a sensible per-scenario retry maximum to avoid flooding the dead letter queue during a credential or endpoint outage.


Pattern 5: Ordered delivery (EOIO)

Strict ordering and cheap retries work against each other: an ordered queue moves only as fast as its oldest failed message. So decide first where order must be enforced. In most cases, the receiver is the better place.

ordered delivery · exclusive queue vs. receiver-side sequencing 

The same failure of message #2 halts option A entirely, while option B keeps the rest flowing and leaves order to the receiver.

Option A: Exclusive JMS queues in Cloud Integration

Since JMS sender adapter 1.4 and receiver adapter 1.6 (early 2025), queues can use the access type Exclusive: a single consumer processes messages one by one, in arrival order (SAP Integration Suite update, March 2025). This is the only way to get sequencing inside Cloud Integration. With non-exclusive queues, even one concurrent process per channel still runs in parallel across worker nodes (KBA 3721606).

Retry works differently on exclusive queues: the JMS broker handles it and there is no separate error queue (KBA 3569999). What that means for the three goals:

  • Human interaction goes up. A permanent error blocks every message behind it. Alert on the first permanent failure, not after a retry budget, because the whole queue is waiting.
  • Parking breaks the order. If message N is parked and N+1 proceeds, the sequence is broken. Parking is only safe when later messages supersede earlier ones, such as full-state master data. Otherwise, the exception subprocess must keep raising the error: block, alert, wait for a fix.
  • Traffic stays low, since only the head message retries. Throughput, however, drops to zero while it does.
  • Queue cost rises with the order scope. One exclusive queue is one sequence. A queue per business key (per material, per order) is impossible within a 30 to 100 queue budget. Putting all keys into one queue means one bad order stops all others.

A practical middle ground is bucketing: hash the business key into a small, fixed number of exclusive queues, for example 4. Order holds per key, because a key always lands in the same bucket. A blocked message then stalls a quarter of the traffic instead of all of it, at the cost of 4 queues.

One caveat applies regardless: the queue only preserves the order in which messages arrived. If the sender or inbound adapter delivers out of order, for example parallel IDoc dispatch hitting different worker nodes, the queue faithfully keeps the wrong order. A community blog on exclusive mode notes that the XI sender adapter did not support EOIO at the time of writing; check the current adapter documentation before relying on end-to-end order.

Option B: Push ordering to the receiving application

The sender stamps every message with an ordering attribute, Cloud Integration passes it through, and the receiver enforces the order. Cloud Integration then uses ordinary non-exclusive queues, so Patterns 1 to 4, including the pipeline, apply unchanged.

Common ordering attributes are a sequence number per business key, a change timestamp, or a version counter on the business object. The receiver then applies one of three rules:

  1. Last writer wins. The receiver stores the version per object and ignores anything older. This fits full-state messages such as master data or status updates, and needs no buffering at all.
  2. Reject until the gap closes. For deltas where every step counts, such as postings or quantity changes, the receiver rejects message N+1 while N is missing. If it answers with a status your exception subprocess classifies as transient, Cloud Integration’s backoff retries it automatically until N has arrived.
  3. Idempotency key. Independently of order, the receiver drops duplicates by a unique message or business ID. This turns at-least-once delivery from retries into effectively exactly-once.

The price is that the receiver must support it. Many standard APIs do not check versions, so this option often means a small staging layer or an extension in the target application.

Comparison

CriterionExclusive queue in Cloud IntegrationSequencing in the receiver
Order scopeWhole queue, or per bucketPer business object
Effect of one failed messageBlocks the queue or bucketBlocks only its own object
Dead letter parkingBreaks the order, except for full-state dataSafe
Retry capNot applicable; block and alertPatterns 1 to 4 apply
Queue cost1 per sequence or bucketNo extra queues
PrerequisiteIn-order delivery into Cloud IntegrationSender stamps order; receiver checks it

Rule of thumb: prefer full-state messages with a version and let the receiver apply last-writer-wins. Use receiver-side gap checks where deltas are unavoidable. Reserve exclusive queues, ideally bucketed, for low-volume scenarios where neither sender nor receiver can be changed.

Open question: whether the current pipeline concept package handles EOIO sequences natively could not be confirmed for this post; check its documentation on the SAP Business Accelerator Hub.


Pattern 6: No JMS at all – push the error back to the sender

The cheapest queue is the one the sender already has. If Cloud Integration processes the message synchronously within the sender’s call and reports success only after delivery, a failure stays with the sender, and the sender’s own persistence and restart tools do the retry.

push back to sender · no queue in SAP Cloud Integration 

The integration flow answers only after the receiver has answered; an error leaves the message in the sender, where its restart job resends it.

This needs zero JMS queues and no dead letter handling in Cloud Integration. It does, however, move the retry logic and the error monitoring into the sending system.

Which senders support it

The table shows common examples and is not exhaustive. Any sender that keeps the message until it receives a positive response, and can restart it, works the same way.

SenderHow the error gets backWhere the message is restarted
SAP IDoc via SOAP (IDoc sender adapter)The HTTP call fails; the IDoc gets an error status in the sending systemBD87, or a scheduled job for outbound IDocs in error (for example RBDAGAIN); AIF where used
SAP ABAP proxy via web service runtime (SOAP sender)A fault is returned to the caller; for one-way calls this needs the SOAP adapter’s Robust processing settingThe sender’s web service monitor and its restart options
SAP XI protocol, asynchronous (XI sender, temporary storage Managed by Integration Flow)Cloud Integration does not persist the message first; the sender gets success only after the flow has delivered it, otherwise the errorThe sender’s local integration engine monitor and its restart jobs; AIF where used
SAP XI protocol, synchronous (Best Effort)The exception goes straight back in the responseThe sender, if its interface is synchronous anyway
SFTP pollingThe file is not deleted or moved, so the next poll picks it up againCloud Integration’s poll cycle; the file server is the queue

For asynchronous XI, the storage setting decides everything. With Data Store or JMS Queue as temporary storage, the sender gets success as soon as the message is stored in Cloud Integration, and the retry stays there (SAP blog on the XI receiver adapter). With Managed by Integration Flow, the message is only marked as successfully sent in the sending system once it has reached the target. The flow then carries the delivery guarantee: duplicates from resends are no longer filtered by the adapter’s idempotent repository, so add an Idempotent Process Call or rely on an idempotent receiver.

Effect on the three goals

  • Queues: none. The sender’s outbound persistence replaces the JMS queue entirely.
  • Traffic is set by the sender. Retries happen only when the sender’s restart job runs. Schedule it with a sensible interval and, where possible, exclude statuses that will never succeed.
  • Human interaction moves to the data owners. Errors appear in BD87, the web service monitor or AIF, where application teams already work. Return a precise error text from the exception subprocess, so a business user can act without opening Cloud Integration.

Error classification still matters, just in a different place: a permanent error must not be restarted every hour by a job. Distinguish it in the returned message so restarts can be filtered.

There is also an ordering bonus. If the sender’s outbound processing is serialized, for example through qRFC queues, a rejected message stops that sender queue. Order is then kept by the sender, without exclusive queues in Cloud Integration.

Prerequisites and risks

  1. The receiver must be reachable at send time. Every receiver outage turns into sender-side errors. That is acceptable only if the sender’s restart is automated.
  2. Timeouts create duplicates. The whole flow must finish within the sender’s HTTP timeout. If the call times out after delivery, the sender resends. Guard with an Idempotent Process Call in the flow or an idempotent receiver.
  3. One receiver per flow. With several receivers or a splitter, a failure after partial delivery makes the resend duplicate the successful part. Either restrict the pattern to point-to-point or make every receiver idempotent.
  4. Restart bursts hit synchronous capacity. A restart job releasing thousands of messages at once loads Cloud Integration’s worker threads and the receiver directly, with no queue to buffer.
  5. The sender needs persistence and restart. SAP backends have both. Many SaaS webhooks and simple HTTP clients do not; for them, a queue in Cloud Integration remains necessary.

This pattern does not combine with the pipeline concept, which is built on JMS decoupling. It fits best for point-to-point scenarios with an SAP sender, a single receiver, short processing times and established monitoring in the sending system.


Pattern 7: Move queuing to an external broker

If the tenant’s JMS budget is the bottleneck, the queue can live outside Cloud Integration. An external broker such as SAP Event Mesh, SAP Integration Suite, advanced event mesh (Solace), Apache Kafka or Azure Service Bus holds the messages, and Cloud Integration only consumes and produces. The JMS queue count then drops to zero; retry and dead letter handling move to the broker.

external broker · redelivery and dead letter queue outside the tenant

Cloud Integration only produces and consumes; the broker counts deliveries, moves exhausted messages to its dead letter queue and replays them from there. For Kafka, the dead letter topic is written by the consuming flow itself (see below).

Broker options at a glance

BrokerCloud Integration adapterRetry and dead letter handling
SAP Event MeshAMQP adapterThe sender adapter has Max. Number of Retries and Delivery Status After Max. Retries; the broker queue has its own redelivery limit and dead message queue. Retries in Cloud Integration can count as additional chargeable messages (KBA 3766919). For the pitfalls of combining both retry layers, see Event Mesh AMQP: the retry trap nobody warns you about
Advanced event mesh (Solace)Dedicated advanced event mesh adapter, or AMQP/RESTAdapter-level retries with configurable intervals; after the last attempt, the message moves to the queue’s dead message queue (community blog)
Apache KafkaKafka adapterEither skip the failed record (at most once) or retry it (at least once), which can retry forever. There is no native dead letter queue: publish failed records to a dead letter topic from the exception subprocess (SAP blog on the Kafka adapter)
Azure Service BusAMQP adapterThe broker moves a message to its dead letter queue after the queue’s maximum delivery count; align that with the adapter’s retry settings (KBA 3689953)

This list covers the brokers most often used with Cloud Integration and is not exhaustive; any broker reachable via AMQP, JMS-compatible or REST interfaces can follow the same pattern.

Dead letter topics in Kafka

Kafka brokers have no dead letter mechanism. A topic is an append-only log, and the broker only tracks each consumer group’s committed offset, not whether a record succeeded or failed.

Dead letter topics exist as a client-side convention:

  • Kafka Connect. Sink connectors can route records they cannot process to a topic named in errors.deadletterqueue.topic.name, together with errors.tolerance=all. Optional context headers carry the error details (MongoDB Kafka connector docs).
  • Client libraries. Spring Kafka’s DeadLetterPublishingRecoverer and similar libraries publish a record to a separate topic after a configured number of retries.

In both cases the dead letter topic is an ordinary topic, and the client decides what goes there. Cloud Integration follows the same idea: the Kafka sender adapter only offers skip or retry, so the exception subprocess sends the failed record via a Kafka receiver adapter to a topic such as orders.dlt. It also writes the original topic, partition, offset and error text as headers (the adapter exposes kafka.TOPIC, kafka.PARTITION and kafka.OFFSET). Replay means re-publishing from that topic to the original one, for example with a small flow triggered on demand.

Effect on the three goals

  • Queues: none in the tenant. Broker queues are sized and priced by the broker, typically with far more headroom than a tenant’s 30 to 100 JMS queues.
  • Human interaction: native dead letter handling. Every broker above offers a dead letter destination per queue and tooling to inspect and replay messages, so Pattern 3 comes almost for free.
  • Traffic: every retry crosses the network. Retries are redeliveries from the broker, so backoff matters even more. On metered brokers such as SAP Event Mesh, retries also cost money.

Align the two retry layers

With an external broker, two components count retries: the Cloud Integration adapter and the broker’s redelivery. If both are configured independently, retries multiply. A message can land in the broker’s dead letter queue while Cloud Integration keeps retrying it, which causes duplicates in the receiver (KBA 3689953).

Make one layer the owner of the retry budget. Usually that is the broker: it persists the delivery count across consumer restarts and owns the dead letter queue. Configure the adapter to hand the message back after its own, smaller number of attempts, and keep the exception subprocess classification from Pattern 2 so permanent errors are rejected at once instead of redelivered.

Ordering

Brokers bring their own ordering mechanisms, which can replace exclusive JMS queues from Pattern 5. Kafka keeps order per partition, and the record key decides the partition; that is the bucketing approach, built in. The catch: a record in retry stalls processing of its partition, and in Cloud Integration potentially of other partitions handled by the same consumer (SAP blog on the Kafka adapter). Azure Service Bus offers sessions and advanced event mesh offers exclusive and partitioned queues for per-key ordering; check whether the Cloud Integration adapter you use supports them.

Trade-offs

  1. Another platform to run. Licensing, monitoring, access control and alerting now span two products.
  2. No shared transaction. Acknowledging a broker message and writing to a receiver or Data Store are not one transaction, so exactly-once depends on idempotent receivers or an Idempotent Process Call.
  3. Connectivity. Each adapter has its own network prerequisites, for example for brokers not exposed to the internet; check them before choosing a broker.

The pattern pays off when the broker exists anyway, when several consumers need the same events, or when the JMS budget has run out. For a single point-to-point scenario, it mostly adds a component.


Reference design and checklist

Put together, every failed attempt ends in exactly one of three places: a timed retry, the parking area, or, after a fix, a restart. Nothing loops forever, and a person only sees what genuinely needs one.

exception subprocess decision flow · 2 decisions, 1 loop

The operator box is the only step that costs human time; everything above it runs unattended.

Checklist for each asynchronous scenario:

  • Exponential backoff on, Maximum Retry Interval at 60 minutes or more
  • Retry cap derived from the outage you want to bridge, externalized as a parameter
  • Transaction handling Required for JMS in the consuming flow
  • Exception subprocess classifies errors: transient, systemic, permanent, unknown
  • Permanent errors parked on the first attempt, with reason and source queue as headers
  • Systemic errors retried slowly, with one alert per interface
  • One shared parking area for the tenant, not one per interface
  • JMS Dead-Letter Queue option on, against out-of-memory crashes
  • For many scenarios or a PI/PO migration: pipeline concept with scenario-specific retry maximums in the Partner Directory

Conclusion

The JMS adapter gives you durable, decoupled retries, but its defaults retry forever and say nothing about which errors are worth retrying. Three additions turn it into a strategy: a time-based retry cap, error classification in the exception subprocess, and one shared, self-describing parking area.

Where the queue lives is the second decision, and it matters as much as the retry logic:

  • In the tenant. For a handful of scenarios, your own flows with JMS queues are enough. As the number of asynchronous scenarios grows, or when you migrate from SAP Process Orchestration, the pipeline concept keeps the budget at 4 to 8 queues for the whole tenant.
  • In the sender. For point-to-point scenarios with an SAP sender, synchronous processing with errors pushed back needs no queue at all; the sender’s persistence and restart jobs do the work.
  • In an external broker. When the JMS budget runs out, several consumers need the same events, or a broker such as SAP Event Mesh, advanced event mesh, Kafka or Azure Service Bus already exists, queues and topics move out of the tenant. Retry and dead letter handling then belong to the broker, and the one rule that matters most is to let a single layer own the retry budget.

Ordering follows the same logic: prefer versioned messages checked by the receiver, or the broker’s own per-key ordering such as Kafka partitions, over exclusive queues that stop for a single failure.

Whichever combination you choose, the goal stays the same: retries that end, traffic that stays proportional to real outages, and operators who only see what truly needs them.