Skip to content

Apply Nullability to spring-integration-kafka #10138

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mjd507
Copy link
Contributor

@mjd507 mjd507 commented Jun 17, 2025

related to #10083

Suppress warning for child classes which parent class (RecordMessagingMessageListenerAdapter or BatchMessagingMessageListenerAdapter) are in spring-kafka module, from the parent constructor, (Object bean, Method method) are non null, but we give(null, null) in spring-integration-kafka. not sure how to solve it.

mjd507 added 2 commits June 17, 2025 22:17
related to spring-projects#10083

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
related to spring-projects#10083

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
@artembilan
Copy link
Member

(Object bean, Method method) are non null, but we give (null, null).

Please, raise a GH issue in https://github.com/spring-projects/spring-kafka.
Doesn't look like those args required to be not-null.

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just couple nit-picks.
Overall this is great.
Thank you!

@@ -195,6 +196,7 @@ public boolean hasExecutorInterceptors() {
return this.executorInterceptorsSize > 0;
}

@SuppressWarnings("NullAway")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this one, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, fixed

@@ -176,15 +179,16 @@ public boolean unsubscribe(MessageHandler handler) {
return this.dispatcher.removeHandler(handler);
}

@SuppressWarnings("NullAway")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not on the whole class, but just that ctor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this warning, opened a PR in spring-kafka, once that merged & published, we can try re-build this.

@@ -281,6 +281,7 @@ protected AttributeAccessor getErrorMessageAttributes(Message<?> message) {
}
}

@SuppressWarnings("NullAway")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: let's see if we can have it only on ctor!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, waiting for spring-kafka

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
@mjd507
Copy link
Contributor Author

mjd507 commented Jun 18, 2025

in local, I add mavenLocal=true in gradle.properties, to use local spring-kafka changes, check build successful,
so I think once spring-kafka publish my changes, this build will be green.

@artembilan
Copy link
Member

I add mavenLocal=true in gradle.properties

Can you point us to the documentation on the matter, please?
This is nice trick but you also could use a composite Gradle build: https://docs.gradle.org/current/userguide/composite_builds.html

@artembilan
Copy link
Member

Ah! I see.
That is not official doc, but rather our own arrangement in the Gradle config 😄 :

    repositories {
        if (project.hasProperty('mavenLocal')) {
            mavenLocal()
        }

@artembilan
Copy link
Member

Hey, @mjd507 !

Any updates?
The related PR in Spring Kafka has been merged.

Thanks

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

Successfully merging this pull request may close these issues.

2 participants