-
Notifications
You must be signed in to change notification settings - Fork 626
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
IllegalStateException on Transaction Scoped Beans #734
Comments
I am not sure there's much we can do about this, except, perhaps, add a boolean property to the admin to disable provisioning of In the meantime, if you can live without the Admin declaring the exchanges/queues/bindings automatically, set its |
For now I'm wrapping my Set in another object, which simply exposes the add, remove, contains, and size methods of the Set. This gets around the problem because my wrapper is not, itself, a subclass of Collection. |
I think this is exactly the way we should go in the Framework. WDYT? |
Fixes spring-projects#734 Add `declareCollections` flag to admin (default false).
Issued a PR with the boolean; we can consider a strong type in future. That said, @seandcrouse - what version are you using? We already suppressed fetching non-singletons here: #406 Fixed in 1.5.6 and later. |
Fixes #734 Add `declareCollections` flag to admin (default false).
We're using:
I'll take a look at #406. Thanks for the great work all of you do! |
Hmmm... Strange... The fix (AMQP-598) should be in 1.5.6
|
spring-amqp/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java
Line 438 in bf5498d
Beans using org.springframework.transaction.support.SimpleTransactionScope fail to get instantiated because RabbitAdmin is not operating inside a transaction. I have a message producer that filters out duplicate messages per transaction. This is done with a transaction scoped Set bean. I know that my producer will only use this bean within that transaction. However, RabbitAdmin is getting every Collection bean, calling the size() method, which causes the class scoped proxy to try to instantiate the bean. This fails because it's not happening inside a transaction.
Sample code:
The text was updated successfully, but these errors were encountered: