Releases: commercetools/commercetools-sync-java
2.1.0
2.1.0
2.0.0
2.0.0
Breaking Changes ⚠️
Sync options improvements:
The signatures of the errorCallback
and warningCallback
changed and their parameter lists are extended, so the library user will have more control and context like resource draft and update actions.
- For
errorCallback
(String errorMessage, Throwable exception)
=>
(SyncException exception, V newResourceDraft, U oldResource, List<UpdateAction<U>> updateActions)
- For
warningCallback
(String warningMessage)
=>
(SyncException exception, V newResourceDraft, U oldResource,)
Reference resolution improvements:
When implementing the sync in the beginning API has only Reference fields for DraftResource and users of the sync library were putting the key in the id field for reference resolution, which was confusing, now API and JVM SDK support ResourceIdentifiers and it supports id or key as a field. Now sync library prefers all References supplied as ResourceIdentifier.ofKey("key")
or ResourceIdentifier.ofId("id")
(in case a Reference ID of the target project is known already).
Or you could use directly our new reference resolution utilities (for example mapToProductDrafts
).
Additionally, if the resource doesn't exist the sync will fail fast as soon as the resource is not found, before attempting to create/update the resource with the unresolved reference, that will improve the performance of the library.