PostHog / posthog-java

Official PostHog java library
MIT License
8 stars 12 forks source link

Added request retry mechanism to HttpSender #29

Closed NSocec-Mindsmiths closed 1 year ago

NSocec-Mindsmiths commented 1 year ago

In its current implementation, the HttpSender class will not try to repeat a POST request if it fails. This can lead to a situation where events get dropped (they get removed from the queue, but they don't arrive at the server).

To resolve this, a retrying mechanism was implemented. The mechanism can be configured by setting the maximum number of retries before giving up and by setting the time interval between retries.

hazzadous commented 1 year ago

Great! Thanks @NSocec-Mindsmiths I'll review this tomorrow time permitting.

hazzadous commented 1 year ago

FYI I've added to your PR here which adds some tests and uuid generation.

NSocec-Mindsmiths commented 1 year ago

Great, thank you for your time.

hazzadous commented 1 year ago

I have merge in #33 and we'll get a release in soon

pauldambra commented 1 year ago

@NSocec-Mindsmiths 👋

We've released posthog-java 1.1.0

Thank you so much for the contribution!