Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensures that there are no issues with context setup when picking custom propagation type #1989

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

marcingrzejszczak
Copy link
Contributor

fixes gh-1987

PropagationFactorySupplier defaultPropagationFactorySupplier(SleuthPropagationProperties properties) {
if (properties.getType().contains(PropagationType.CUSTOM)) {
throw new IllegalStateException(
"Please register a bean with the following signature [extends Propagation.Factory implements Propagation<String>] to override the default Sleuth behaviour or [implements PropagationFactorySupplier] to reuse it.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

this.delegate = delegate;
}

private Propagation.Factory propagationFactory() {
if (this.propagationFactory == null) {
this.propagationFactory = this.delegate.getIfAvailable(() -> NoOpPropagation.INSTANCE);
this.propagationFactory = this.delegate.getIfAvailable(() -> () -> NoOpPropagation.INSTANCE).get();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inception. :)

@jonatan-ivanov jonatan-ivanov merged commit 8b61684 into main Jul 2, 2021
@jonatan-ivanov jonatan-ivanov deleted the issues_#1987_custom_propagation branch July 2, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackOverflowError when using propagation type custom
2 participants