spring-cloud / stream-applications

Functions and Spring Cloud Stream Applications for data driven microservices
https://spring.io/projects/spring-cloud-stream-applications
250 stars 104 forks source link

rabbitmq port mismatch when cloudfoundry rabbitmq service is deployed on non-standard port #197

Open gpsmit opened 2 years ago

gpsmit commented 2 years ago

Hi All,

We are experiencing an issue with the starter apps deployed on cloud foundry with SCDF We have a cloud foundry instance that can expose rabbitmq services outside of cloudfoundry. When we deploy such an exposed rabbitmq service it will be assigned a random available port (non default 5671/5672) with TLS enabled. All the vcap service variables are properly bound to the deployed apps, with the random port also visible in the stream starter environment variables We are using the app imports from rabbitmq-maven-latest.

But, when we deploy the stream starter apps through SCDF, they do not pick up the random port (4101 in this deployment) instead trying the default TLS port 5671:

LOGS: Attempting to connect to: [redacted:5671].

When we manually set spring.rabbitmq.port=4101 still nothing happens.

LOGS: Attempting to connect to: [redacted:5671].

It seems the redacted url is resolved from the cloud foundry variables, but the port isnt.

When we manually set the spring.rabbitmq.addresses property to the rabbitmq-uri:port/vhost everything is back to normal, but the apps should be able to resolve it from the cloud foundry variables.

We opened a ticket with vmware but they are pointing to the stream starter apps. We see this in all the starter apps that we tried so far (http/bridge/rabbit/log)

SCDF INFO: Data Flow Server Implementation Name: scdf-pro-server Version: 1.3.2

Versions Implementation Version: 1.3.2 (scdf-pro-server) Core: 2.8.2 (Spring Cloud Data Flow Core) Dashboard: 3.1.2 (Spring Cloud Dataflow UI) Shell: 2.8.2 (Spring Cloud Data Flow Shell)

Runtime Environment - Skipper Deployer Implementation Version: 2.7.2 Name: Spring Cloud Skipper Server Spi Version: 2.7.2 Java Version: 1.8.0_292 Platform Api Version: N/A Platform Client Version: N/A Platform Host Version: N/A Platform Type: Skipper Managed Spring Boot Version: 2.4.7 Spring Version: 5.3.8

Platform-specific Information of the Skipper Deployer default: cloudfoundry

Runtime Environment - Task Launcher Implementation Version: 2.6.2 Name: CloudFoundryAppDeployer Spi Version: 2.6.2 Java Version: 1.8.0_292 Platform Api Version: 2.164.0 Platform Client Version: unknown Platform Host Version: unknown Platform Type: Cloud Foundry Spring Boot Version: 2.4.7 Spring Version: 5.3.8

onobc commented 2 years ago

Hi @gpsmit ,

If this is still an issue for you can you send a dump of the CF VCAP properties (w/ any sensitive info redacted) so we can understand what is going into the apps?

Thanks