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

Value parameters in ReactiveKafkaProducerTemplate should be nullable #3617

Closed
aelfric opened this issue Nov 7, 2024 · 5 comments · Fixed by #3651
Closed

Value parameters in ReactiveKafkaProducerTemplate should be nullable #3617

aelfric opened this issue Nov 7, 2024 · 5 comments · Fixed by #3651

Comments

@aelfric
Copy link

aelfric commented Nov 7, 2024

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

For example:

3.1.1 - but seems like this is true in the latest versions too

Describe the bug

Similar to #1825 the @NonNullApi applied to the
package org.springframework.kafka.core.reactive means that static analysis tools think it is not possible to pass null into org.springframework.kafka.core.reactive.ReactiveKafkaProducerTemplate#send(java.lang.String, K, V), but null is allowed and required if we want to publish null tombstone messages.

To Reproduce

Create a ReactiveKafkaProducerTemplate instance and call send on it with a value of null, run SonarLint on that class.

Expected behavior

The value parameter in this method and the other related methods should be annotated as nullable.

@artembilan
Copy link
Member

Good catch!
Feel free to contribute the fix: https://github.com/spring-projects/spring-kafka/blob/main/CONTRIBUTING.adoc

@jukekxm
Copy link
Contributor

jukekxm commented Nov 25, 2024

@artembilan @aelfric Hello. if you are not working on this, can I work on it?

@aelfric
Copy link
Author

aelfric commented Nov 25, 2024

I was going to work on it, but I've had trouble building the project under my company's firewall and haven't had a chance to get the issues resolved. If you want to make the change, go ahead.

@jukekxm
Copy link
Contributor

jukekxm commented Nov 25, 2024

@aelfric Thank you!
I will create PR for this issue.

@jukekxm
Copy link
Contributor

jukekxm commented Nov 26, 2024

#3651
I created PR.
I would appreciate it if you could review!

@sobychacko sobychacko modified the milestones: 3.3.0, 3.3.1 Nov 27, 2024
spring-builds pushed a commit that referenced this issue Dec 7, 2024
… nullable (#3651)

Fixes: #3617

* add @nullable parameter to send method
* change package for @nullable
* fix import order checkstyle

(cherry picked from commit e27a344)
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.

5 participants