You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Spring Framework on Google Cloud provides support for Cloud Foundry’s <ahref="https://docs.pivotal.io/partners/gcp-sb/index.html">GCP Service Broker</a>.
47
+
Our Pub/Sub, Cloud Spanner, Storage, Cloud 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>
48
+
</div>
49
+
<divclass="paragraph">
50
+
<p>In order to take advantage of the Cloud Foundry support make sure the following dependency is added:</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.
62
+
For example, to retrieve the provisioned Pub/Sub topic, you can use the <code>vcap.services.mypubsub.credentials.topic_name</code> property from the application environment.</p>
63
+
</div>
64
+
<divclass="admonitionblock note">
65
+
<table>
66
+
<tr>
67
+
<tdclass="icon">
68
+
<iclass="fa icon-note" title="Note"></i>
69
+
</td>
70
+
<tdclass="content">
71
+
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.
72
+
This includes both MySQL and PostgreSQL bindings to the same app.
73
+
</td>
74
+
</tr>
75
+
</table>
76
+
</div>
77
+
<divclass="admonitionblock warning">
78
+
<table>
79
+
<tr>
80
+
<tdclass="icon">
81
+
<iclass="fa icon-warning" title="Warning"></i>
82
+
</td>
83
+
<tdclass="content">
84
+
In order for the Cloud SQL integration to work in Cloud Foundry, auto-reconfiguration must be disabled.
85
+
You can do so using the <code>cf set-env <APP> JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '{enabled: false}'</code> command.
86
+
Otherwise, Cloud Foundry will produce a <code>DataSource</code> with an invalid JDBC URL (i.e., <code>jdbc:mysql://null/null</code>).
<p><ahref="https://docs.cloudfoundry.org/devguide/services/user-provided.html">User-provided services</a> enable developers to use services that are not available in the marketplace with their apps running on Cloud Foundry.
95
+
For example, you may want to use a user-provided service that points to a shared Google Service (like Cloud Spanner) used across your organization.</p>
96
+
</div>
97
+
<divclass="paragraph">
98
+
<p>In order for Spring Framework on Google Cloud to detect your user-provided service as a Google Cloud Service, you must add an <ahref="https://docs.cloudfoundry.org/devguide/services/managing-services.html#instance-tags-create">instance tag</a> indicating the Google Cloud Service it uses.
99
+
The tag should simply be the Cloud Foundry name for the Google Service.</p>
100
+
</div>
101
+
<divclass="paragraph">
102
+
<p>For example, if you create a user-provided service using Cloud Spanner, you might run:</p>
<p>This allows Spring Framework on Google Cloud to retrieve the correct service properties from Cloud Foundry and use them in the auto configuration for your application.</p>
111
+
</div>
112
+
<divclass="paragraph">
113
+
<p>A mapping of Google service names to Cloud Foundry names are provided below:</p>
0 commit comments