8 lines
4.0 KiB
HTML
8 lines
4.0 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>164. Cloud Foundry</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud.html" title="Spring Cloud"><link rel="up" href="multi_spring-cloud-gcp-reference.html" title="Part XVIII. Spring Cloud GCP"><link rel="prev" href="multi__google_cloud_vision.html" title="163. Google Cloud Vision"><link rel="next" href="multi__kotlin_support.html" title="165. Kotlin Support"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">164. Cloud Foundry</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__google_cloud_vision.html">Prev</a> </td><th width="60%" align="center">Part XVIII. Spring Cloud GCP</th><td width="20%" align="right"> <a accesskey="n" href="multi__kotlin_support.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="_cloud_foundry" href="#_cloud_foundry"></a>164. Cloud Foundry</h2></div></div></div><p>Spring Cloud GCP provides support for Cloud Foundry’s <a class="link" href="https://docs.pivotal.io/partners/gcp-sb/index.html" target="_top">GCP Service Broker</a>.
|
|
Our Pub/Sub, Cloud Spanner, Storage, Stackdriver Trace and Cloud SQL MySQL and PostgreSQL starters are Cloud Foundry aware and retrieve properties like project ID, credentials, etc., that are used in auto configuration from the Cloud Foundry environment.</p><p>In cases like Pub/Sub’s topic and subscription, or Storage’s bucket name, where those parameters are not used in auto configuration, you can fetch them using the VCAP mapping provided by Spring Boot.
|
|
For example, to retrieve the provisioned Pub/Sub topic, you can use the <code class="literal">vcap.services.mypubsub.credentials.topic_name</code> property from the application environment.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If the same service is bound to the same application more than once, the auto configuration will not be able to choose among bindings and will not be activated for that service.
|
|
This includes both MySQL and PostgreSQL bindings to the same app.</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left">Warning</th></tr><tr><td align="left" valign="top"><p>In order for the Cloud SQL integration to work in Cloud Foundry, auto-reconfiguration must be disabled.
|
|
You can do so using the <code class="literal">cf set-env <APP> JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}'</code> command.
|
|
Otherwise, Cloud Foundry will produce a <code class="literal">DataSource</code> with an invalid JDBC URL (i.e., <code class="literal">jdbc:mysql://null/null</code>).</p></td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__google_cloud_vision.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="multi_spring-cloud-gcp-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="multi__kotlin_support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">163. Google Cloud Vision </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud.html">Home</a></td><td width="40%" align="right" valign="top"> 165. Kotlin Support</td></tr></table></div></body></html> |