Customizing the Java SDK
The SDK uses Jackson for serializing and deserializing JSON. The default configured ObjectMapper uses some modules to correctly work with commercetools APIs. The details can be found in JsonUtils.createObjectMapper(ModuleOptions).
To allow customization of the
ObjectMapper, the SDK uses ServiceLoader for ModuleSupplier. Adding the file
resources/META-INF/services/io.vrap.rmf.base.client.utils.json.ModuleSupplier to your project with the fully qualified class name of the module supplier to be used will register the supplied modules.
To deserialize them as a String, the ObjectMapper can be configured with ModuleOptions. The ApiModule also loads the configuration options using
System.getProperty(String) (for example: commercetools.deserializeDateAttributeAsString).
Tuning the client
In some frameworks there is no support for asynchronous execution and so it is necessary to wait for the responses.
The client can wait for responses with the method
This method enforces a timeout for resilience and throws an
Configure the underlying HTTP client
ApiRootBuilder has create methods which allow passing a preconfigured HTTP client.