-
Notifications
You must be signed in to change notification settings - Fork 614
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
The DefaultBinderFactory.propagateSharedBeans() is looking for shared bean in wrong context #2728
Comments
For context, we're getting this issue while trying to upgrade the Solace binder to Spring Cloud |
cc @olegz |
@Nephery So I want to understand better what issue you are really experiencing and how to reproduce it,. |
Look at the call to the method and definition of the method.
and
Here, method Let me know if my understanding is in correct. |
@olegz the issue that we were facing was that To break down what we have:
|
@olegz this doesn't look like it works. As @mayur-solace mentioned, we think this might be because |
@Nephery Can you please try with the latest snapshot? |
@olegz I tested out the latest |
The call to the this.propagateSharedBeans(...) is passing the fromContext and toContext contexts in wrong order. The binderProducingContext should be toContext.
Also calling the binderProducingContext.refresh() before call to this.propagateSharedBeans(..) creates new beans (that depends on shared beans) before shared beans are available for auto-wiring.
Code snippet from
org.springframework.cloud.stream.binder.DefaultBinderFactory
should the call be instead....
is there a tests that covers shared bean propagation ?
spring-cloud-stream/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderFactory.java
Line 484 in 29c3cd7
The text was updated successfully, but these errors were encountered: