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

Refactor TrackerEvents for event payload creation (close #291) #293

Closed mscwilson closed 2 years ago

mscwilson commented 2 years ago

For issue #291, as part of a larger refactoring of Tracker and Emitter to allow event sending retry and batching by byte size.

Tracker.track(event) now directly creates a TrackerPayload, which is passed to the Emitter for storage and sending. The Tracker event processing is currently within the main thread.

TrackerEvent has been removed. Event sending callbacks have been partially removed - the functionality is gone but the builder options remain for now.

mscwilson commented 2 years ago

The main difference between SimpleEmitter and BatchEmitter is GET vs POST. So it's an opportunity to be opinionated :)

mscwilson commented 2 years ago

I've copied and pasted the threadpool (and threadfactory) from Emitter into Tracker. I left the Emitter threads as is for now.