Skip to content

A NullPointerException in the MetricsRetryListener when provided RetryCallback comes without proper getLabel() implementation #491

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

Closed
artembilan opened this issue May 8, 2025 · 0 comments
Labels
Milestone

Comments

@artembilan
Copy link
Member

More info in the: spring-projects/spring-integration#9985.
The error looks like this:

java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at io.micrometer.core.instrument.ImmutableTag.<init>(ImmutableTag.java:37)
	at io.micrometer.core.instrument.Tag.of(Tag.java:31)
	at io.micrometer.core.instrument.Tags.of(Tags.java:247)
	at org.springframework.retry.support.MetricsRetryListener.close(MetricsRetryListener.java:116)

If we do just this:

SimpleRetryPolicy simpleRetryPolicy = new SimpleRetryPolicy();
RetryContext retryContext = simpleRetryPolicy.open(null);
RetryCallback<Object, Throwable> retryCallback = context -> null;
this.metricsRetryListener.open(retryContext, retryCallback);
this.metricsRetryListener.close(retryContext, retryCallback, null);
@artembilan artembilan added this to the 2.0.12 milestone May 8, 2025
@artembilan artembilan added the bug label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant