Event stream consumer circuit breakers

Does anyone have any best practices for relay / firehose / event-stream consumption? I’m working through a relay consumer that looks like it “just stopped” receiving events last night.

I’m assuming its some issue on my end, and I’d like to have some reasonable circuit breakers in place. So far the list includes:

  • If I stop receiving events on an open / active ws connection after 3 minutes then warn
  • If I stop receiving events on an open / active ws connection after 5 minutes then disconnect and reconnect at the last known good cursor

Any suggestions?

Is websocket ping/pong implemented ?

1 Like

When I was playing around with consuming the firehose last year my plan was to implement two listeners and then dedupe in a message queue, but I come from a finance background; so that is probably overkill (not to mention expensive).

I’m interested in what you’ll come up with.

1 Like

have you looked into using tap in your system indigo/cmd/tap/README.md at main · bluesky-social/indigo · GitHub.

The firehose consumer automatically reconnects with exponential backoff on relay failures.

2 Likes