The Cloud Foundry Connector is part of the Spring Cloud Connectors project.
This connector discovers services that are bound to an application running in Cloud Foundry. (Since Cloud Foundry enumerates each service in a consistent format, Spring Cloud Connectors does not care which service provider is providing it.)
Cloud Detection
This connector checks for the presence of a VCAP_APPLICATION environment variable. This is a system-provided environment variable which is specific to Cloud Foundry. If the variable exists, the connector will be activated.
Service Detection
The connector inspects Cloud Foundry’s VCAP_SERVICES environment variable to detect available services. This variable stores connection and identification information for service instances that are bound to Cloud Foundry applications.
Below is an example of a VCAP_SERVICES entry (edited for brevity).
"p-rabbitmq": [
{
"credentials": {
"http_api_uri": "https://ca30db57-a396:[email protected]:12345/api",
"http_api_uris": [
"https://ca30db57-a396:[email protected]:12345/api"
],
"uri": "amqp://ca30db57-a396:[email protected]/322e7782-eb1f",
"uris": [
"amqp://ca30db57-a396:[email protected]/322e7782-eb1f"
]
},
"label": "p-rabbitmq",
"name": "rabbit-bus",
"plan": "standard",
"tags": [
"rabbitmq"
]
}
]
For most supported services, the connector will consider the following fields:
|
Attributes or names of backing technologies behind the service. |
|
The service offering’s name (not to be confused with a service instance’s name). |
|
A URI pertaining to the service instance. |
If they are present, it will also consider the following fields:
|
A JDBC connection string. |
|
A service URL, where |
Supported Services
This connector comes with built-in support for a variety of service types and providers. The criteria by which it establishes availability of each service are described below.
Application monitoring (New Relic)
The connector will check for:
-
tagsincludingmonitoringornewrelic -
labelbeginning with themonitoringornewrelictags
Cassandra
The connector will check for:
-
cqlsh_portandnode_ipsfields incredentials
DB2
The connector will check for:
-
tagsincludingsqldb,dashDB, ordb2 -
labelbeginning with thesqldb,dashDB, ordb2tags -
uriusing the schemedb2 -
jdbcUrlusing the subprotocoldb2in the JDBC URL -
db2Uri,db2uri,db2Url, ordb2urlfields incredentials
MongoDB
The connector will check for:
-
tagsincludingmongodb -
labelbeginning with themongodbtag -
uriusing the schememongodb -
mongodbUri,mongodburi,mongodbUrl, ormongodburlfields incredentials
MySQL
The connector will check for:
-
tagsincludingmysql -
labelbeginning with themysqltag -
uriusing the schememysql -
jdbcUrlusing the subprotocolmysqlin the JDBC URL -
mysqlUri,mysqluri,mysqlUrl, ormysqlurlfields incredentials
Oracle
The connector will check for:
-
uriusing the schemeoracle -
jdbcUrlusing the subprotocoloraclein the JDBC URL -
oracleUri,oracleuri,oracleUrl, ororacleurlfields incredentials
PostgreSQL
The connector will check for:
-
tagsincludingpostgresql -
labelbeginning with thepostgresqltag -
uriusing the schemepostgres -
jdbcUrlusing the subprotocolpostgresin the JDBC URL -
postgresUri,postgresuri,postgresUrl, orpostgresurlfields incredentials
RabbitMQ
The connector will check for:
-
tagsincludingrabbitmq -
labelbeginning with therabbitmqtag -
uriorurisusing the schemeamqporamqps -
amqpUri,amqpuri,amqpsUri,amqpsuri,amqpUrl,amqpurl,amqpsUrl, oramqpsurlfields incredentials
Redis
The connector will check for:
-
tagsincludingredis -
labelbeginning with theredistag -
uriusing the schemeredis -
redisUri,redisuri,redisUrl, orredisurlfields incredentials
SMTP
The connector will check for:
-
tagsincludingsmtp -
labelbeginning with thesmtptag -
uriusing the schemesmtp -
smtpUri,smtpuri,smtpUrl, orsmtpurlfields incredentials
SQL Server
The connector will check for:
-
uriusing the schemesqlserver -
jdbcUrlusing the subprotocolsqlserverin the JDBC URL -
sqlserverUri,sqlserveruri,sqlserverUrl, orsqlserverurlfields incredentials