Skip to content

KafkaOperations is missing nullable annotations #3813

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
gbaso opened this issue Mar 20, 2025 · 1 comment · Fixed by #3837
Closed

KafkaOperations is missing nullable annotations #3813

gbaso opened this issue Mar 20, 2025 · 1 comment · Fixed by #3837

Comments

@gbaso
Copy link
Contributor

gbaso commented Mar 20, 2025

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

3.3.3

Describe the bug

KafkaOperations is in a package annotated with @NonNullApi, therefore all method parameters are considered non-nullable, unless annotated differently. KafkaOperations does not have any nullability annotations, despite the data to send being @Nullable in KafkaTemplate.

Expected behavior

KafkaOperations should have nullability annotations similar to KafkaTemplate.

@artembilan
Copy link
Member

Confirmed.
For example KafkaTemplate:

	@Override
	public CompletableFuture<SendResult<K, V>> sendDefault(@Nullable V data) {

but KafkaOperations:

CompletableFuture<SendResult<K, V>> sendDefault(V data);

And there are many other similar to this missing annotations.

Please, feel free to contribute the fix: https://github.com/spring-projects/spring-kafka/blob/main/CONTRIBUTING.adoc

gbaso added a commit to gbaso/spring-kafka that referenced this issue Apr 14, 2025
sobychacko pushed a commit that referenced this issue Apr 14, 2025
Fixes: #3813

Issue link: #3813

**Auto-cherry-pick to `3.3.x`**

Signed-off-by: Giacomo Baso <[email protected]>
Co-authored-by: Giacomo Baso <[email protected]>
spring-builds pushed a commit that referenced this issue Apr 14, 2025
Fixes: #3813

Issue link: #3813

Signed-off-by: Giacomo Baso <[email protected]>
Co-authored-by: Giacomo Baso <[email protected]>
(cherry picked from commit 9db48fc)
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