r/apachekafka • u/DevEJesus • 18d ago
Question How do you get third-party webhooks (Stripe, GitHub, Shopify) into Kafka today?
Hi all,
I'm curious how teams here handle incoming webhooks when the rest of their system runs on Kafka.
From what I've seen, most people end up writing a small receiver service that:
- verifies the provider's signature (different for every provider)
- deduplicates events, since providers sometimes send the same one twice
- buffers or retries when Kafka is slow or down
- produces the event to a topic
And then there's usually no easy way to see what arrived, what failed, or to replay an event.
A few questions:
Do you run your own receiver, use a service (Hookdeck, Airbyte, something else), or skip Kafka for webhooks entirely?
What's been the most annoying part: signatures, duplicates, lost events, debugging?
Have you ever lost or double-processed a webhook event because of this?
If a hosted service did this reliably and pushed events into your own Kafka cluster, would that be useful, or is it simple enough to keep in-house?
I'm thinking about building something in this space, so honest answers (including "not worth it") are very welcome. Thanks!
6
u/cornelliusfilmore 18d ago edited 18d ago
Writing your HTTP endpoint to consume a web is what would advise as opposed to using a third-party service.
- Signature verification: Providers usually have an SDK that allows you to do that out of the box.
- Event deduplication: if you are already using Kafka then writing idempotent consumer is your bread-and-butter. Meaning, you should already be doing it anyways.
- Buffer or retries: if you don’t want to rely on the webhook provider to retry, you could publish first to a queue on SQS and then publish it to Kafka.
If losing events and double processing events are a huge constraint, I’d do the following:
- Write incoming web hooks to a queue (SQS for instance)
- Consume from the queue and publish to Kafka. (Manually or use a connector)
- Idempotency: to simplify, I’d leave idempotency to the consumer of the Kafka topic.
2
u/Batharzel Condense 17d ago
Hi, I work for Condense.
Like the above comment, I would also advise on building your own receiver with custom logic. I built and deployed mine on Condense directly.
I think maintaining idempotency is usually the annoying part considering you won't know which event has been received twice, but usually the webhook doesn't miss an event, so it's about a case of idempotency.
We also store the events in a database along with a receivedAt timestamp and an event ID for our own logging. We have not lost any data (yet) since our product doesn't have payments coming in all the time.
Ofcourse, pushing to a Kafka Cluster is useful! We push it to a database for our own auditing but a Kafka Cluster with its own dashboard can serve the same purpose
2
u/tasn1 17d ago
Just have your own receiver and directly write to kafka. It's not hard.
You can defo use a service (e.g. I'm the founder of Svix and we have Ingest for that), though if all you want is writing to kafka, just build it yourself. Make sure however that this endpoint is reliable and doesn't go down for maintenance or depends on a database that may go for maintenance to work.
2
u/New-Departure-5969 17d ago
two things that still bite even with the sdk. the signature check has to run on the raw request bytes, if your framework parses the json first and you verify against a re-serialized body it just never matches, and people end up turning verification off to "fix" it. and use the providers own event id as your dedupe key, not an id you generate on receive, otherwise a retry from stripe looks like a brand new event. key the topic by the object id though (the payment/customer), so stuff for the same thing at least lands on one partition.
the one nobody mentioned is ordering. stripe says outright that events can show up out of order, so for anything that changes state dont trust the order they land on the topic. either compare the objects timestamp/version against what you already have, or just re-fetch the object from their api in the consumer and treat the webhook as a "something changed" ping. that kinda answers your reconciliation question too, if youre re-fetching anyway a periodic sweep over their events list to catch anything that never arrived is cheap to add