-
Notifications
You must be signed in to change notification settings - Fork 596
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
RabbitMQ: spring.cloud.stream.rabbit.bindings.* properties not recognized in Native/AOT builds #2938
Comments
@mjbingen We are investigating this issue. Can you please add instructions for how exactly to reproduce the issue? Your sample is a great start, and I see a native branch there. How do you build, run, and test the app? Also, how do you verify that things don't work as expected? Once you clarify these things, we will continue looking at this issue. Thanks! |
@mjbingen Any updates? |
Hi @sobychacko - sorry for the delay. Here is the full set of instructions to build the sample application to highlight the issue.
Let me know if this helps or you need any other details/tests to help with the investigation. |
@mjbingen Sorry for the delay. This turned out to be a bug in the binder. We just addressed it via the above-referenced commit. It should be available as part of the |
Many thanks @sobychacko ! I confirmed the |
Describe the issue
When building a Spring Boot app with Spring Cloud Stream as a native image with GraalVM, the properties scoped under
spring.cloud.stream.rabbit.bindings.*
do not appear to be recognized in the native image and are defaulted.This is problematic as properties like
exchangeType
,routingKeyExpression
, andbindingRoutingKey
produce defaults that lead to unexpected behaviors. For example, the exchangeType will always betopic
and the routing keys default to#
.It is important to note that properties scoped under
spring.cloud.function.definition
,spring.cloud.stream.output-bindings
, andspring.cloud.stream.bindings
seem to function as desired.To Reproduce
A simple reproducible example can be found in full here: https://github.com/mjbingen/spring-cloud-stream-sandbox/tree/native
Example:
application.yml
Code - expect to self-consume messages when REST endpoint is hit only from
onFoo
method that is bound to the exchange with matching routing key. However, when application is run as a native image, all bounding keys default to#
, so the YAML-specified routing key is ignored and both methods consume the message.Version of the framework
Spring Boot 3.2.5
Spring Cloud Stream 4.1.1
Oracle GraalVM 21
Expected behavior
Properties defined in
application.yml
and present at compile time should be reflected in the native image and behave just like the JVM version.Screenshots
Additional context
Similar to prior issue with Kafka streams. However, RabbitMQ binder documentation suggests properties must be defined in the prefix above.
The text was updated successfully, but these errors were encountered: