No unique service maching interface error in Spring Boot Cloud Foundry error

后端 未结 2 2117
情话喂你
情话喂你 2021-01-24 22:59

I am trying to follow this tutorial https://github.com/cf-platform-eng/spring-boot-cities/tree/master/cities-service to run my spring boot application in Cloud Foundry. I have l

2条回答
  •  难免孤独
    2021-01-24 23:13

    Just to summarize the overall solution for other readers.

    If you have a scenario where you want to have a spring boot application talk to a database (hosted in other machine) and then run the application from cloud foundry. Then follow some of the tips below.

    1. Once you deploy your Spring Boot application and want to use Spring Boot cloud connector make sure you have all the proper dependencies in your classpath (spring-boot-cloud-connector and jar.
    2. If you want to bind a service instance with the application .Make sure the credentials adhere to this specification http://cloud.spring.io/spring-cloud-connectors/spring-cloud-cloud-foundry-connector.html#_postgresql
    3. In the service instance parameters make sure you use the uri parameter not depend on the username and password to construct the uri
    4. Make sure your database instance is actually running and you have created application service groups to allow outbound communication from your cloud foundry app. https://docs.cloudfoundry.org/concepts/asg.html#viewing

    Steps 3 and 4 were the mistakes i made. Once corrected the application works fine.

    Best Regards, Saurav

提交回复
热议问题