Skip to content

Return a reasonable default instead of throwing a UnsupportedOperationException #2419

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
aadamovi opened this issue Sep 29, 2022 · 2 comments · Fixed by #2421
Closed

Return a reasonable default instead of throwing a UnsupportedOperationException #2419

aadamovi opened this issue Sep 29, 2022 · 2 comments · Fixed by #2421

Comments

@aadamovi
Copy link

In what version(s) of Spring for Apache Kafka are you seeing this issue?

For example:

2.8.5

Between 2.7.0 and 2.8.2

Describe the bug
This request is based on the discussion on Stackoverflow: https://stackoverflow.com/questions/73894535/unsupportedoperationexception-when-using-retryabletopic

In short, the producer factory wrapper should implement getConfigurationProperties() and call the delegate factory to get its properties. In a case when the producer factory doesn't honor this contract instead of failing with a java.lang.UnsupportedOperationException perhaps the code could fall back to some default value.

To Reproduce

Expected behavior

I would expect for the value to be set to some reasonable default instead of throwing a UnsupportedOperationException

Sample
The URL contains a full description and a small sample of how the @RetryableTopic was used.

https://stackoverflow.com/questions/73894535/unsupportedoperationexception-when-using-retryabletopic

@garyrussell garyrussell added this to the 3.0.0-RC1 milestone Sep 29, 2022
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Sep 29, 2022
Resolves spring-projects#2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwind an USOE.

**cherry-pick to 2.9.x, 2.8.x**
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Sep 29, 2022
Resolves spring-projects#2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwind an USOE.

**cherry-pick to 2.9.x, 2.8.x**
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Sep 29, 2022
Resolves spring-projects#2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwing an USOE.

**cherry-pick to 2.9.x, 2.8.x**
artembilan pushed a commit that referenced this issue Sep 29, 2022
Resolves #2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwing an USOE.

**cherry-pick to 2.9.x, 2.8.x**
artembilan pushed a commit that referenced this issue Sep 29, 2022
Resolves #2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwing an USOE.

**cherry-pick to 2.9.x, 2.8.x**

* Fix `CompletableFuture` conflicts in the tests
artembilan pushed a commit that referenced this issue Sep 29, 2022
Resolves #2419

We try to obtain the configured request timeout using the producer factory's
configuration properties. Some wrappers (e.g. open tracing) do not implement
this method, so fallback to the default instead of throwing an USOE.

**cherry-pick to 2.9.x, 2.8.x**

* Fix `CompletableFuture` conflicts in the tests
@aadamovi
Copy link
Author

thank you for taking care of this.

one last thing, what 2.8.X version is this going to get into?

@artembilan
Copy link
Member

See release schedule here: https://github.com/spring-projects/spring-kafka/milestones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants