Hi,
I looked at the following for changing the processing mode.
My implementation is as follows:
private synchronized void initializeTransientApis() {
if (!transientApisInitialized) {
try {
if (transientPlatform instanceof PlatformImpl) {
// Register the transient interceptor
((PlatformImpl) transientPlatform).registerInterceptor(new HttpClientInterceptor() {
@Override
public Invocation.Builder apply(Invocation.Builder builder) {
return builder.header("X-Cumulocity-Processing-Mode", "TRANSIENT");
}
});
// Initialize transient APIs
measurementApiTransient = transientPlatform.getMeasurementApi();
transientApisInitialized = true;
log.info("Transient APIs initialized successfully");
} else {
log.warn("Platform is not PlatformImpl, falling back to header-based approach");
}
} catch (Exception e) {
log.warn("Could not initialize transient APIs: ", e);
}
}
}
When I run the code I get the message:
Platform is not PlatformImpl, falling back to header-based approach
How can I register the interceptor?
Regards Christof