com.solace.spring.cloud.stream.binder.tracing.TracingProxy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-stream-binder-solace Show documentation
Show all versions of spring-cloud-stream-binder-solace Show documentation
A Spring Cloud Stream Binder implementation using the Solace Java API (JCSMP)
The newest version!
package com.solace.spring.cloud.stream.binder.tracing;
import com.solacesystems.jcsmp.BytesXMLMessage;
import com.solacesystems.jcsmp.SDTMap;
import com.solacesystems.jcsmp.XMLMessage;
import lombok.RequiredArgsConstructor;
import org.springframework.messaging.Message;
import java.util.function.Consumer;
/**
* Proxy class for the Solace binder to access tracing components.
* Always use this instead of directly using tracing components in Solace binder code.
* Allows for the Solace binder to still function correctly without micrometer on the classpath.
*/
@RequiredArgsConstructor
public class TracingProxy {
public static final String TRACING_HEADER_KEY = "TRACING_HEADER_KEY";
private final TracingImpl tracingImpl;
public SDTMap getTracingHeader() {
return tracingImpl.getTracingHeader();
}
public Consumer> wrapInTracingContext(SDTMap tracingHeader, Consumer> messageConsumer) {
return this.tracingImpl.wrapInTracingContext(tracingHeader, messageConsumer);
}
}