Skip to content

Commit

Permalink
#425 allow only one propagator per concern (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
malafeev authored May 28, 2020
1 parent 6aee383 commit c86a2af
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ public static void initializePropagators(List<String> propagators) {

DefaultContextPropagators.Builder propagatorsBuilder = DefaultContextPropagators.builder();

boolean addedPropagator = false;
for (String propagatorId : propagators) {
HttpTextFormat textPropagator = TEXTMAP_PROPAGATORS.get(propagatorId.trim().toLowerCase());
if (textPropagator != null) {
if (addedPropagator) {
log.warn(
"Only one propagator per concern can be added, " + textPropagator + " is ignored");
continue;
}
propagatorsBuilder.addHttpTextFormat(textPropagator);
log.info("Added " + textPropagator + " propagator");
addedPropagator = true;
} else {
log.warn("No matching propagator for " + propagatorId);
}
Expand Down

0 comments on commit c86a2af

Please sign in to comment.