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:
-
tags
includingmonitoring
ornewrelic
-
label
beginning with themonitoring
ornewrelic
tags
Cassandra
The connector will check for:
-
cqlsh_port
andnode_ips
fields incredentials
DB2
The connector will check for:
-
tags
includingsqldb
,dashDB
, ordb2
-
label
beginning with thesqldb
,dashDB
, ordb2
tags -
uri
using the schemedb2
-
jdbcUrl
using the subprotocoldb2
in the JDBC URL -
db2Uri
,db2uri
,db2Url
, ordb2url
fields incredentials
MongoDB
The connector will check for:
-
tags
includingmongodb
-
label
beginning with themongodb
tag -
uri
using the schememongodb
-
mongodbUri
,mongodburi
,mongodbUrl
, ormongodburl
fields incredentials
MySQL
The connector will check for:
-
tags
includingmysql
-
label
beginning with themysql
tag -
uri
using the schememysql
-
jdbcUrl
using the subprotocolmysql
in the JDBC URL -
mysqlUri
,mysqluri
,mysqlUrl
, ormysqlurl
fields incredentials
Oracle
The connector will check for:
-
uri
using the schemeoracle
-
jdbcUrl
using the subprotocoloracle
in the JDBC URL -
oracleUri
,oracleuri
,oracleUrl
, ororacleurl
fields incredentials
PostgreSQL
The connector will check for:
-
tags
includingpostgresql
-
label
beginning with thepostgresql
tag -
uri
using the schemepostgres
-
jdbcUrl
using the subprotocolpostgres
in the JDBC URL -
postgresUri
,postgresuri
,postgresUrl
, orpostgresurl
fields incredentials
RabbitMQ
The connector will check for:
-
tags
includingrabbitmq
-
label
beginning with therabbitmq
tag -
uri
oruris
using the schemeamqp
oramqps
-
amqpUri
,amqpuri
,amqpsUri
,amqpsuri
,amqpUrl
,amqpurl
,amqpsUrl
, oramqpsurl
fields incredentials
Redis
The connector will check for:
-
tags
includingredis
-
label
beginning with theredis
tag -
uri
using the schemeredis
-
redisUri
,redisuri
,redisUrl
, orredisurl
fields incredentials
SMTP
The connector will check for:
-
tags
includingsmtp
-
label
beginning with thesmtp
tag -
uri
using the schemesmtp
-
smtpUri
,smtpuri
,smtpUrl
, orsmtpurl
fields incredentials
SQL Server
The connector will check for:
-
uri
using the schemesqlserver
-
jdbcUrl
using the subprotocolsqlserver
in the JDBC URL -
sqlserverUri
,sqlserveruri
,sqlserverUrl
, orsqlserverurl
fields incredentials