snowplow / snowplow-java-tracker

Snowplow event tracker for Java. Add analytics to your Java desktop and server apps, servlets and games. (See also: snowplow-android-tracker)
http://snowplowanalytics.com
Apache License 2.0
24 stars 36 forks source link

Choose HTTP response codes not to retry #316

Closed mscwilson closed 2 years ago

mscwilson commented 2 years ago

Issue #156 added retry to the Emitter. When an attempt to send is made, all 2xx HTTP response codes are considered successful. The event payloads are deleted from the tracker. Anything other than 2xx is considered a failure; the event payloads are returned to the buffer. Attempts to send will continue indefinitely, but with an increasing delay between attempts.

Certain response codes, especially those within 4xx, should perhaps not be retried.

Eventually, it would be good to create a RetryPolicy with complex options, and the ability to start and stop tracking, and change the collector URL while running. As a starting point, let's improve the retry mechanism by allowing users to choose which response codes should be fatal.