Snowplow Java Tracker 0.3.0 released
Today we are introducing the release of the Snowplow Java Tracker version 0.3.0.
Similar to the previous 0.2.0 release, this too is a mixture of minor & stability fixes. We’ve made only a few minor interface changes, so it shouldn’t affect current users of the Java Tracker too much.
You can find more on the new additions futher down in this post:
- Strings replaced with Maps for Context
- Timestamp for Trackers
- Logging with SLF4J
- Dependency updates
- Unit testing
This is probably the largest part of this release. Previously, users would need to pass in the context as a JSON-formatted string of data which would then be encoded accordingly. We’ve now removed that option and replaced it with a Map. You can see a comparison of the method signature before and after:
This should give a bit more flexibility and ease while creating your custom contexts.
You may have noticed in the previous example’s method signature that there was an extra argument with a timestamp. In order to keep the Java Tracker consistent with the other trackers, we’ve added the ability to set your own timestamp for the event you’re tracking. If you would rather use the default timestamp, you can just set a 0.
Here are two cases where we set our own timestamp as well as use the default:
We’ve added some initial debug logging to our trackers using SLF4J. This should make it easier to debug issues should any arise. While there is only debug-level logging currently, we are looking to add some info-level logging in the future if needed.
The Jackson library that we introduced in our previous 0.2.0 release has been updated from 1.9.3 to 188.8.131.52. This was done to stay on the latest stable release and shouldn’t need any change from your side.
We’ve changed the
slf4j-api dependency to
slf4j-simple (which includes
slf4j-api) from version 1.7.5 to 1.7.7.
More unit tests have been added to the project for continued stability checks, the majority of which are for the PayloadMap class. Feel free to use some of these as example code.