Retry Logic with Circuit Breaker Pattern — CoPilot Prompts | Neura Market
    Neura MarketNeura Market/CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityCoPilotCoPilot
    DeepSeekDeepSeekStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityPluginsTrendingGenerate
    CoPilotPromptsRetry Logic with Circuit Breaker Pattern
    Back to Prompts
    Architecture

    Retry Logic with Circuit Breaker Pattern

    GitHub Community April 23, 2026
    0 copies 0 likes

    Creates a resilient HTTP client with exponential backoff retry, circuit breaker, and request deduplication.

    Prompt
    Implement a resilient HTTP client with retry logic and circuit breaker pattern:
    
    Retry configuration:
    1. Max retries: 3 (configurable)
    2. Retry on: 5xx errors, network timeouts, ECONNRESET
    3. Do NOT retry: 4xx errors (except 429 Too Many Requests)
    4. Backoff: exponential with jitter (base 1s, max 30s, random 0-1000ms jitter)
    
    Circuit breaker:
    1. States: CLOSED (normal), OPEN (failing), HALF_OPEN (testing)
    2. Open threshold: 5 consecutive failures
    3. Reset timeout: 60 seconds
    4. Half-open: allow 1 test request
    5. Success in half-open returns to CLOSED
    
    Additional features:
    - Request timeout: 10 seconds configurable
    - Request deduplication for identical in-flight requests
    - Bulkhead pattern: limit concurrent requests per service
    - Fallback response when circuit is open
    - Metrics: success rate, latency percentiles, circuit state changes
    
    Generate as a wrapper around fetch/axios that works as a drop-in replacement.

    How to Use

    Open Copilot Chat and paste this prompt.

    Comments

    More Prompts

    View all
    Development

    GitHub Copilot Code Review Companion

    Structured code review using GitHub Copilot. Security audit, performance analysis, test coverage assessment, and PR review checklists for production codebases.

    C
    Community
    Productivity

    Microsoft 365 Copilot Meeting Workflow

    End-to-end meeting productivity with M365 Copilot. Covers pre-meeting prep, real-time notes, action item extraction, and automated follow-ups across Teams and Outlook.

    C
    Community
    Code Generation

    Build State Machine Implementation

    Create a type-safe state machine with transitions, guards, actions, and visualization support using XState patterns.

    P
    PromptWizard
    112 190
    Excel

    Excel Copilot: Complex Array Formulas

    Create dynamic array formulas using FILTER, SORT, UNIQUE, and SEQUENCE for advanced data manipulation.

    P
    PromptCraft
    275 31
    Coding

    Security Code Audit

    Comprehensive security audit checking for OWASP Top 10 vulnerabilities with proof-of-concept examples, fixes, and a hardened code version.

    C
    Community
    Coding

    Bug Triage and Root Cause Analysis

    Systematic bug triage with root cause analysis, ranked hypotheses, step-by-step debugging instructions, and preventive solutions.

    C
    Community

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.