Files
spring-cloud-sleuth/docs
Adrian Cole f01a65b035 Deprecates spring.sleuth.baggage-keys property (#1605)
The `spring.sleuth.baggage-keys` property assigned two headers for each
baggage. This causes unnecessary overhead and can be accomplished in another
way now:

```java
public class MyCode {
  static final BaggageField USER_ID = BaggageField.create("userId");

  @Autowired CurrentTraceContext currentTraceContext;

  @Nullable
  public String currentUserId() {
    return USER_ID.getValue(currentTraceContext.get());
  }

}

// In your @Configuration type, if you want to map multiple prefixes...
@Bean
BaggagePropagationConfig userIdBaggageConfig() {
  return SingleBaggageField.newBuilder(MyBaggage.USER_ID)
      .addKeyName("baggage-userId")
      .addKeyName("baggage_userId")
      .build();
}
```
2020-04-06 19:40:17 +08:00
..