Package brave.propagation
Class B3Propagation<K>
java.lang.Object
brave.propagation.B3Propagation<K>
- All Implemented Interfaces:
Propagation<K>
public final class B3Propagation<K> extends Object implements Propagation<K>
Implements B3 Propagation
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
B3Propagation.FactoryBuilder
Defaults toB3Propagation.Format.MULTI
for client/server spans andB3Propagation.Format.SINGLE_NO_PARENT
for messaging.static class
B3Propagation.Format
Describes the formats used to inject headers.Nested classes/interfaces inherited from interface brave.propagation.Propagation
Propagation.Getter<C,K>, Propagation.KeyFactory<K>, Propagation.Setter<C,K>
-
Field Summary
Fields Modifier and Type Field Description static Propagation.Factory
FACTORY
-
Method Summary
Modifier and Type Method Description <C> TraceContext.Extractor<C>
extractor(Propagation.Getter<C,K> getter)
<C> TraceContext.Injector<C>
injector(Propagation.Setter<C,K> setter)
Replaces a propagated field with the given value.List<K>
keys()
The propagation fields defined.static B3Propagation.FactoryBuilder
newFactoryBuilder()
-
Field Details
-
Method Details
-
newFactoryBuilder
-
keys
Description copied from interface:Propagation
The propagation fields defined. If your carrier is reused, you should delete the fields here before callingPropagation.Setter.put(Object, Object, String)
.For example, if the carrier is a single-use or immutable request object, you don't need to clear fields as they couldn't have been set before. If it is a mutable, retryable object, successive calls should clear these fields first.
Note: Depending on the format, keys returned may not all be mandatory.
Note: If your implementation carries "extra fields", such as correlation IDs, do not return the names of those fields here. If you do, they will be deleted, which can interfere with user headers.
- Specified by:
keys
in interfacePropagation<K>
-
injector
Description copied from interface:Propagation
Replaces a propagated field with the given value. Saved as a constant to avoid runtime allocations. For example, a setter for anHttpURLConnection
would be the method referenceURLConnection.addRequestProperty(String, String)
- Specified by:
injector
in interfacePropagation<K>
- Parameters:
setter
- invoked for each propagation key to add.
-
extractor
- Specified by:
extractor
in interfacePropagation<K>
- Parameters:
getter
- invoked for each propagation key to get.
-