-
Notifications
You must be signed in to change notification settings - Fork 31
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
ServiceInfoPropertySourceAdapter disables RabbitAutoConfiguration #36
Comments
@pavax Here's the reason this is being done in the SCS Connectors: When a project includes the SCS starters, it gets The RabbitMQ connection info for the SCS circuit breaker is wrapped in the service binding in such a way that an app doesn't see it as raw RabbitMQ connection info, but the SCS Connector code for circuit breaker knows to look inside this wrapper to get the RMQ connection info. Since Boot auto-configuration doesn't see any RabbitMQ connection info, it defaults to So the short story was: add SCS starters to your app, your app's health actuator reports Our fix for this was to conditionally disable RMQ auto-configuration when it appears that the application isn't configuring its own RMQ connection info (such that Boot auto-configuration default of This is a bit convoluted (and hard to explain), but we were trying to optimize for the case where an app using SCS doesn't have its own RMQ connection, while still allowing for the case where an app does have its own RMQ connection. In your sample app you've configured RMQ connection info in application-local.yml, which should result in the SCS Connectors not disabling RMQ auto-configuration in that profile. In the cloud profile, if you've bound your app to an RMQ service instance then Spring Cloud Connectors will create the RMQ connection, which overrides Boot auto-configuration. So I'm not sure why this isn't working the way you'd expect it to. |
@scottfrederick thanks four you answer. the application-local.yml is only used for local dev on my machine - SCS should not even know about that since the 'local' profile is NOT active. My main problem is, that the Secondly there is also no yes there is a Have a look at
The only solution is, that I'd define my own
... but it still it always evaluates to false and thus disabled the also I did update my example app to demonstrate this problem (please give it a try and deploy it to your pivotal cf instance) BTW: would it be a solution for you guys to just disable the
... rather than to copy & paste the |
#39 has been merged in - hopefully this resolves the issue. I'll mark this as closed. |
The
ServiceInfoPropertySourceAdapter.java
'silently' disables the RabbitAutoConfiguration since SCS 1.5+I created a sample project: https://github.com/pavax/cloudfoundry-sample
deploy it and go to the
/management/env
Actuator Endpoint (username: root / password: secret)you'll find
Is this really intended? IMHO: It is kinda "harsh" to disable a AutoConfigiration completely. Since in many project we depend on the classes provided by Spring Boots' AutoConfigurations. In this particular case several beans are expecting a RabbitTemplate and even more everything done and exposed in the RabbitAnnotationDrivenConfiguration such as the SimpleRabbitListenerContainerFactory.
Funny Fact: No exception is beeing raised if you app is simply trying to listen to Rabbit Messages since the RabbitListener are not triggered at all (due to the missing
@EnableRabbit
annotation that is exposed for you in the RabbitAutoConfiguration -> RabbitAnnotationDrivenConfiguration. Kinda nasty to find these kind of bugs :)Note:
This Bug was already mentioned here: pivotal-cf/spring-cloud-services-starters#15 but since it's root-cause has nothing to do with the 'spring-cloud-services-starters' I thought I give it a try and create it this repository.
The text was updated successfully, but these errors were encountered: