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

KafkaOperations is missing nullable annotations #3813

Open
gbaso opened this issue Mar 20, 2025 · 1 comment
Open

KafkaOperations is missing nullable annotations #3813

gbaso opened this issue Mar 20, 2025 · 1 comment

Comments

@gbaso
Copy link

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

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

No branches or pull requests

2 participants