BlogComparisons · November 1, 2026 · 6 min read

Contact Form 7 Retry Policies: Tenacity vs stamina vs Polly vs Failsafe vs Resilience4j

Compare Tenacity, stamina, Polly, Failsafe and Resilience4j for maintained CF7 lead adapters, with retry limits, runtime fit and durable-work boundaries.

A maintained Contact Form 7 lead adapter encounters a brief destination failure. A retry library can express which failures to repeat, how long to wait and when to stop. Tenacity, stamina, Polly, Failsafe and Resilience4j provide that policy layer in different runtimes, but they do not decide whether repeating a lead-creation request is safe.

Five mint paths meeting a dark green circular ring, with an ivory card on one path.
Generated conceptual illustration; not a product screenshot or measured result.

This comparison covers components inside custom integrations, not native CF7 connectors. We reviewed official documentation and core licenses on November 1, 2026. The selection advice is editorial analysis; no comparative performance test or production delivery experiment was performed.

Separate a short retry policy from durable work

A policy can repeat a callable while the process exists. A durable queue retains pending work across restarts and schedules later execution. Those responsibilities may cooperate, but selecting a retry library does not automatically provide a persistent lead ledger, a worker or crash recovery.

Start with the destination’s contract. Decide which errors are transient, which writes are safe to repeat, what total budget applies and how an uncertain outcome is reconciled. Keep the same supported idempotency reference across attempts where the destination implements that behavior. Do not infer duplicate protection from a library’s retry feature.

Library Runtime and useful fit Policy boundary Core license
Tenacity Python with detailed policy control Configure bounded stop and wait behavior Apache-2.0
stamina Python with opinionated retry ergonomics Wrapper around Tenacity, not a separate queue MIT
Polly .NET resilience pipelines Retry count excludes the original call BSD-3-Clause
Failsafe Java policy composition Distinguish attempts from retries Apache-2.0
Resilience4j Java registry and configuration model Maximum attempts includes the initial call Apache-2.0

Tenacity

Tenacity is a general-purpose Python retry library with configurable stop conditions, wait strategies, exception filters, result predicates and coroutine support. It is a candidate when the integration team wants direct control over the policy rather than a single prescribed configuration.

Strengths: separate policy choices make it possible to state why an operation should repeat and how the repetition ends. That can suit a Python lead adapter with several destination operations whose contracts differ. A read lookup and a record creation should not inherit identical behavior merely because they share an HTTP client.

Limitations: the documentation’s bare decorator behavior can retry indefinitely without waiting. Do not mistake a minimal example for an operational delivery policy. Set explicit stop, wait and exception rules, then check how they interact with the HTTP client’s timeout.

Cost and fit: Tenacity is Apache-2.0 licensed. Choose it for Python when detailed control is useful and someone will own that configuration. Persist long-lived pending work elsewhere instead of keeping a WordPress request or worker occupied through an extended outage.

stamina

stamina is an opinionated wrapper around Tenacity. Its documented scope includes exponential backoff with jitter, bounded attempts and time, async support and instrumentation. It is a different interface to the same underlying retry ecosystem, not an independent durable-delivery system.

Strengths: the narrower configuration style can help a Python team standardize common retry behavior. Its tutorial requires an explicit exception selection and describes a hook that can inspect a failure and return a custom backoff.

Limitations: a broad HTTP exception class can still include responses that should not repeat. Review the destination-specific predicate. The documented custom-backoff path overrides the normal backoff machinery, so verify the complete timing behavior rather than assuming jitter and other settings still apply automatically.

Cost and fit: the wrapper uses MIT; retain the notices of its dependencies separately. Choose stamina when its supported conventions fit the Python adapter and reduce unnecessary policy variation. Compare it with direct Tenacity configuration if the integration needs unusual control.

Polly

Polly’s retry strategy belongs to its .NET resilience-pipeline model. It can select failures using ShouldHandle and configure backoff, jitter, a delay generator and retry callbacks. It fits a maintained .NET service receiving or processing CF7 inquiries through an explicit integration.

Strengths: the pipeline approach gives a .NET team a consistent place to express policy and telemetry. A result-aware delay generator can use information from the response when the application supplies the appropriate interpretation.

Limitations: MaxRetryAttempts counts retries in addition to the original call. A configured value of three therefore permits four total executions. The documentation also warns against using retries as indefinite periodic scheduling. A retry strategy is not a replacement for a durable job scheduler.

Cost and fit: the core license is BSD-3-Clause. Choose Polly for a .NET-owned adapter, and review the API generation used by existing examples before copying them. Specify cancellation and operation boundaries so a caller’s abandoned work does not keep repeating unexpectedly.

Failsafe

Failsafe provides Java retry policies with configurable attempts, duration, delays, jitter, handled failures and abort conditions. Policies can be composed with other resilience behavior. It suits a Java adapter whose team wants explicit policy objects around selected operations.

Strengths: the API distinguishes maximum attempts from maximum retries and offers listeners for failed attempts, scheduled retries and exhaustion. That makes it useful to review the actual execution budget alongside the operational evidence the adapter retains.

Limitations: a default retry policy has no delay between attempts. Configure pacing deliberately rather than applying immediate repetition to a rate-limited destination. Policy composition also needs review: a timeout policy and a retry policy can produce different total behavior depending on their arrangement.

Cost and fit: the core is Apache-2.0 licensed. Choose Failsafe for a Java service when its policy model is comfortable to maintain. Verify exhaustion and abort outcomes in a synthetic fixture so the business record is not silently labeled delivered after the last failure.

Resilience4j

Resilience4j provides Java retry configuration through a registry and configurable predicates, wait intervals and exception selection. It is a candidate when a Java application already uses its resilience configuration model and wants the lead adapter to follow that established pattern.

Strengths: result and exception predicates can distinguish business-returned failures from thrown exceptions. The documented interval function options allow policy to account for attempts and outcomes. An existing team convention may make the resulting configuration easier to review than a second policy framework.

Limitations: maxAttempts includes the initial call. The documented intervalFunction and intervalBiFunction options cannot both be used together. Review defaults, ignored exceptions and exhaustion behavior rather than transferring settings directly from a library with different counting semantics.

Cost and fit: the core license is Apache-2.0. Choose it when the maintained Java application benefits from its registry model. An in-memory registry does not by itself persist pending inquiries or restore a partially completed delivery after a process restart.

Compare execution budgets with the same fixture

Use a local stub that fails a defined number of times, then returns a synthetic success. Record actual call count, selected delays, terminal state and cancellation behavior. Include a permanent rejection and an uncertain write. The desired result is evidence that the policy follows your contract, not a ranking based on how aggressively it retries.

Check every retry layer. Three worker executions, each allowing three HTTP attempts, can make nine outbound calls. Those illustrative counts are arithmetic, not measured delivery results. Decide which layer owns short transient retries and which owns scheduled recovery, and cap their combined budget.

Our HTTP 429 guide covers provider waiting instructions, while the background-job comparison covers separate worker components. Neither a timeout nor a retry exhaustion proves that a remote create operation never committed.

Choose within the runtime you can operate

Use Tenacity for detailed Python control, stamina for its Python conventions, Polly for .NET pipelines, Failsafe for Java policy objects, or Resilience4j for its Java registry model. All five cores have open-source licenses rather than a per-lead core subscription; operations, support and dependent services still have costs.

We publish CF7 Analytics. Our free Svetlik Analytics for Contact Form 7 documents submission statistics and trends. Keep integration retries, reconciliation and final destination evidence in the adapter that owns them, with a named person responsible for exhausted or uncertain work.