Java Code Examples for brave.propagation.Propagation#Getter

The following examples show how to use brave.propagation.Propagation#Getter . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TracingChannelInterceptor.java    From spring-cloud-sleuth with Apache License 2.0 6 votes vote down vote up
TracingChannelInterceptor(Tracing tracing,
		Propagation.Setter<MessageHeaderAccessor, String> setter,
		Propagation.Getter<MessageHeaderAccessor, String> getter) {
	this.tracing = tracing;
	this.tracer = tracing.tracer();
	this.threadLocalSpan = ThreadLocalSpan.create(this.tracer);
	this.injector = tracing.propagation().injector(setter);
	this.extractor = tracing.propagation().extractor(getter);
	this.integrationObjectSupportPresent = ClassUtils.isPresent(
			"org.springframework.integration.context.IntegrationObjectSupport", null);
	this.hasDirectChannelClass = ClassUtils
			.isPresent("org.springframework.integration.channel.DirectChannel", null);
	this.directWithAttributesChannelClass = ClassUtils
			.isPresent(STREAM_DIRECT_CHANNEL, null)
					? ClassUtils.resolveClassName(STREAM_DIRECT_CHANNEL, null) : null;
}
 
Example 2
Source File: TraceSpringIntegrationAutoConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@Bean
TracingChannelInterceptor traceChannelInterceptor(Tracing tracing,
		Propagation.Setter<MessageHeaderAccessor, String> traceMessagePropagationSetter,
		Propagation.Getter<MessageHeaderAccessor, String> traceMessagePropagationGetter) {
	return new TracingChannelInterceptor(tracing, traceMessagePropagationSetter,
			traceMessagePropagationGetter);
}
 
Example 3
Source File: TraceSpringMessagingAutoConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
Propagation.Getter<MessageHeaderAccessor, String> traceMessagePropagationGetter() {
	return MessageHeaderPropagation.INSTANCE;
}
 
Example 4
Source File: TraceAutoConfigurationCustomizersTests.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Bean
Propagation.Getter<MessageHeaderAccessor, String> traceMessagePropagationGetter() {
	return (headers, key) -> null;
}
 
Example 5
Source File: CustomTraceIdPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
@Override public <R> Extractor<R> extractor(Propagation.Getter<R, String> getter) {
  return delegate.extractor(new Getter<>(getter, customTraceIdName));
}
 
Example 6
Source File: CustomTraceIdPropagation.java    From brave with Apache License 2.0 4 votes vote down vote up
Getter(Propagation.Getter<R, String> delegate, String customTraceIdName) {
  this.delegate = delegate;
  this.customTraceIdName = customTraceIdName;
}