spring-cloud-sleuth-core/src/test/java/org/springframework/cloud/sleuth/instrument/messaging/TracingChannelInterceptorTest.java
@Test public void producerConsidersOldSpanIds() {
		channel.addInterceptor(producerSideOnly(interceptor));

		channel.send(MessageBuilder.withPayload("foo")
				.setHeader("X-B3-TraceId", "000000000000000a")
				.setHeader("X-B3-ParentSpanId", "000000000000000a")
				.setHeader("X-B3-SpanId", "000000000000000b").build());

		assertThat(channel.receive().getHeaders())
				.containsEntry("X-B3-ParentSpanId", "000000000000000b");
	}
/**
	 * If the producer is acting on an un-processed message (ex via a polling consumer), it should
	 * look at trace headers when there is no span in scope, and use that as the parent context.
	 */
If the producer is acting on an un-processed message (ex via a polling consumer), it should
look at trace headers when there is no span in scope, and use that as the parent context.
If the producer is acting on an un - processed message ( ex via a polling consumer ) it should look at trace headers when there is no span in scope and use that as the parent context .
@Test public void producerConsidersOldSpanIds() {
		channel.addInterceptor(producerSideOnly(interceptor));
		channel.send(MessageBuilder.withPayload("foo")
				.setHeader("X-B3-TraceId", "000000000000000a")
				.setHeader("X-B3-ParentSpanId", "000000000000000a")
				.setHeader("X-B3-SpanId", "000000000000000b").build());
		assertThat(channel.receive().getHeaders())
				.containsEntry("X-B3-ParentSpanId", "000000000000000b");
	}
@ Test public void producerConsidersOldSpanIds ( ) { channel . addInterceptor ( producerSideOnly ( interceptor ) ) ; channel . send ( MessageBuilder . withPayload ( "foo" ) . setHeader ( "X-B3-TraceId" , "000000000000000a" ) . setHeader ( "X-B3-ParentSpanId" , "000000000000000a" ) . setHeader ( "X-B3-SpanId" , "000000000000000b" ) . build ( ) ) ; assertThat ( channel . receive ( ) . getHeaders ( ) ) . containsEntry ( "X-B3-ParentSpanId" , "000000000000000b" ) ; }
If the producer is acting on an un-processed message (ex via a polling consumer), it should
 look at trace headers when there is no span in scope, and use that as the parent context.
If the producer is acting on an un - processed message ( ex via a polling consumer ) it should look at trace headers when there is no span in scope and use that as the parent context .