Snowplow Java Tracker 0.12.0 released

We are pleased to announce the release of our Java tracker version 0.12.0.

The headline new feature is the addition of retry (with exponential backoff) to event sending. Events that fail to send (HTTP request codes other than 2xx) are returned to the buffer for subsequent retry. To provide greater control over event buffering, we’ve provided a new EventStore interface, and InMemoryEventStore class. Users can set the capacity of the InMemoryEventStore buffer. Because retry is now handled by the tracker, we’ve removed the event-sending callbacks and the TrackerEvent class.

We’ve also removed a couple of methods from Events. It shouldn’t have been possible for users to set custom eventId or deviceCreatedTimestamp values (for custom timestamps, use trueTimestamp). The eventId and deviceCreatedTimestamp are no longer Event properties, but generated at TrackerPayload initialisation inside the Tracker, during Tracker.track(). We’ve added a return type to Tracker.track(): the eventId UUID string of the tracked event payload.

The Java tracker provides an Emitter interface, and two Emitter classes: BatchEmitter and SimpleEmitter. We couldn’t think of any occasion when BatchEmitter wouldn’t be a better choice, so SimpleEmitter has been deprecated. Some old, unused methods have been removed, such as Utils.getTransactionId().

The final breaking change is an improvement to the API. The bufferSize Emitter property - how many events to send in one request - is now more accurately called batchSize.

We’ve added API docs, hosted here. The updated Snowplow Docs - including full migration guide - will be live very soon. We know they’re currently quite out of date: we apologise.

We hope you enjoy this release. Please feel free to raise issues on Github if you have any comments or suggestions. We’d love to hear how you’re using the Java tracker.

New features:
Add retry to in-memory storage system (#156) - breaking change
Return eventId from Tracker.track() (#304) - breaking change
Choose HTTP response codes not to retry (#316)
Extract event storage from Emitter (#290)
Refactor TrackerEvents for event payload creation (#291) - breaking change
Deprecate SimpleEmitter (#309)
Add Javadoc generation (#137)
Rename bufferSize to batchSize (#306) - breaking change

Under the hood:
Attribute community contributions in changelog (#289)
Update simple-console example (#295)
Add benchmarking tests (#300)
Update JUnit and Jackson-databind dependencies (#294)
Update copyright notices to 2022 (#312)

Upgrading

Java tracker version 0.12.0 is available on Maven Central.
The project’s source code can be found here.

3 Likes