Skip to content

Conversation

@omercelikceng
Copy link
Contributor

@omercelikceng omercelikceng commented Aug 14, 2023

Resolves #2787

Hello, I had opened nested-configuration-issue before. I have created a request to resolve this error. I would appreciate it if you take the time to look into it.

The ConsumerProperties and ProducerProperties configs under BindingProperties were being initialized to null. For this reason, none of the consumer or producer configurations under Bindings work. This is the reason why the autoStartup configuration in the issue I opened does not work.

This problem only occurs when I build with spring native. (Spring Native Docker Image)

For example, the yellow marked configurations in the picture will not work.

nested-property-issue

…erProperties)) in the BindingServiceProperties class do not work when built with native image. For this reason, the consumer and producer properties under the Bindings configuration do not work. That's why the @NestedConfigurationProperty annotation was added.
@omercelikceng omercelikceng changed the title Nested Configuration Problem For ProducerProperties And ProducerProperties Nested Configuration Problem For ProducerProperties And ProducerProperties In Spring Native Image Aug 14, 2023
@omercelikceng omercelikceng changed the title Nested Configuration Problem For ProducerProperties And ProducerProperties In Spring Native Image Nested Configuration Problem For ProducerProperties And ConsumerProperties under BindingProperties(Spring Native Docker Image) Aug 14, 2023
@artembilan
Copy link
Member

I believe the problem is related to this: spring-projects/spring-boot#36909

@omercelikceng
Copy link
Contributor Author

omercelikceng commented Aug 14, 2023

I understand, what you said may be true. I added the @NestedConfigurationProperty annotation to the relevant configuration files (ConsumerProperties and ProducerProperties). Then I built of spring-cloud-stream source code and when I tried the code again and it worked. That's why I open the pull request. What's wrong with fixing the code by adding the @NestedConfigurationProperty annotation?

If I understand correctly, when the problem you mentioned is solved, we won't even need to put the @NestedConfigurationProperty annotation, right?
I would like to give one more additional information. I made a project myself independently of spring cloud stream. I faced the same issue when I tried to read nested configs like the issue here. Then I added the @NestedConfigurationProperty annotation and my problem was solved. Based on this situation, I thought we should add the @NestedConfigurationProperty annotation with the new versions.

@artembilan
Copy link
Member

Thanks for confirmation.

Well, this is summer time and many of us are on vacation.
Plus we have a conference next week, so we are busy preparing.

I'll meet @olegz over there and we will chat about merging your PR.

Also, please, confirm that this PR is fixing that issue: #2787

@omercelikceng
Copy link
Contributor Author

Hello, have a nice holiday. Also, thank you very much for your interest. I read an information told from Spring Boot's official site. That's why I opened a pull request like this. But there may be some points that I am not aware of. I am sharing the document about you.

Related Documentation: https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-hints

image

@sobychacko
Copy link
Contributor

@omercelikceng The changes look reasonable to me. Thanks for the PR. It is now merged upstream via 1497140 and back-ported to 4.0.x.

@sobychacko sobychacko closed this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto Startup Feature of Spring Cloud Function Not Working in Spring Native(in application.yml)

3 participants