Programování Expert Claude

Webhook handler s retry logic

Implementace robustního webhook handleru s retry a idempotency.

Prompt text

Délka: Střední
Vytvoř webhook handler pro [WEBHOOK PROVIDER - např. Stripe, GitHub, Shopify].

**Requirements:**

**1. Verification:**
- Signature verification
- Timestamp validation
- Replay attack prevention

**2. Processing:**
- Parse webhook payload
- Event type routing
- Idempotency (deduplicate events)
- Transaction handling

**3. Retry Logic:**
- Exponential backoff
- Max retry attempts
- Dead letter queue
- Failure notifications

**4. Error Handling:**
- Return 200 immediately
- Process async (queue)
- Log all events

**5. Testing:**
- Mock webhooks
- Retry scenarios

Framework: [FRAMEWORK]. Queue: [REDIS/RABBITMQ/SQS]. Language: [LANGUAGE].
Interaktivní tvůrce

Příklad použití

Vstup:

Vytvoř Stripe webhook handler pro payment events (success, failed). Framework: Express + TypeScript. Queue: Redis Bull. Include: signature verify, idempotency, retry (max 5×, exponential backoff).

Výstup:

Complete webhook handler: Express endpoint POST /webhooks/stripe, signature verification using stripe.webhooks.constructEvent, idempotency with Redis (store event IDs, TTL 24h), immediate 200 response then async processing via Bull queue, event routing (payment_intent.succeeded → updateOrder, payment_intent.failed → notifyCustomer), retry logic (5 attempts, delays: 1s, 2s, 4s, 8s, 16s), failed jobs → dead letter queue + Slack alert, comprehensive logging (event ID, type, processing time). Testing: mock Stripe webhooks, simulate failures, verify idempotency prevents duplicates.

Kde použít tento prompt?

Najděte vhodné AI nástroje pro použití tohoto promptu a maximalizujte jeho efektivitu.

Objevte další AI prompty

Prozkoumejte naši sbírku Programování promptů a najděte ty, které vám pomohou dosáhnout lepších výsledků.