Using User-Provided Service Instances

By default, a Spring Cloud Data Flow service instance uses MySQL for PCF for its backing relational database service and RabbitMQ for PCF for its backing messaging service. When creating a Spring Cloud Data Flow service instance, you can configure it to use Cloud Foundry user-provided services for its dependent data services instead. See below for information about configuring a Data Flow service instance to use an alternative dependent data service.

Dependent Service Parameters

You can specify that a Data Flow service instance should use a user-provided service instance by passing configuration parameters to the cf create-service command in JSON using the -c flag. The parameters used to configure alternative dependent data services for a Data Flow service instance are listed below.

Parameter Function
relational-data-service.user-provided A JSON object containing connection information for the relational database service used to store task history.
messaging-data-service.user-provided A JSON object containing connection information for the messaging service used for event messaging.

See the following sections for information about using these parameters.

User-Provided Relational Database Service

You can use the relational-data-service parameter to supply the configuration for a user-provided relational database service. This parameter contains a JSON object user-provided, with fields for each of the connection values needed to provision a Cloud Foundry user-provided relational database service instance.

The relational database service can be the default MySQL for PCF service or any other relational database service. It must provide a relational database.

An example of fields contained in the user-provided object for a relational database service is shown below.

{
  "uri":"mysql://kempercrabb:fake-password@123.234.456.879:3306/vigil",
  "username": "kempercrabb",
  "password": "fake-password",
  "dbname": "vigil",
  "host": "123.234.456.879",
  "port": 3306,
  "tags": ["mysql"]
}

To create a Spring Cloud Data Flow service instance using these connection values for the service instance’s relational database service instance:

$ cf create-service p-dataflow standard data-flow -c '{"relational-data-service": { "user-provided": {"uri":"mysql://kempercrabb:fake-password@123.234.456.879:3306/vigil","username":"kempercrabb","password":"fake-password","dbname":"vigil","host":"123.234.456.879","port":3306,"tags":["mysql"]} }}'

User-Provided Messaging Service

You can use the messaging-data-service parameter to supply the configuration for a user-provided messaging service. This parameter contains a JSON object user-provided, with fields for each of the connection values needed to provision a Cloud Foundry user-provided messaging service instance.

The messaging data service can be the default RabbitMQ for PCF service or another messaging service. It must provide either a RabbitMQ server or a Kafka server.

An example of fields contained in the user-provided object for a messaging service is shown below.

{ 
  "dashboard_url": "https://api.cloudamqp.com/console/a-GUID-would-go-here/details",
  "username": "buckstorm", 
  "vhost": "buckstorm", 
  "password": "fake-password",
  "ssl": false,
  "hostname": "stonehill.rmq.cloudamqp.com",
  "uri": "amqp://buckstorm:fake-password@stonehill.rmq.cloudamqp.com/buckstorm",
  "http_api_uri": "https://buckstorm:fake-password@stonehill.rmq.cloudamqp.com:1883/api",
  "tags": ["rabbitmq"]
}

To create a Spring Cloud Data Flow service instance using these connection values for the service instance’s messaging service instance:

$ cf create-service p-dataflow standard data-flow -c '{"messaging-data-service": { "user-provided": {"dashboard_url":"https://api.cloudamqp.com/console/a-GUID-would-go-here/details","username":"buckstorm","vhost":"buckstorm","password":"fake-password","ssl":false,"hostname":"stonehill.rmq.cloudamqp.com","uri":"amqp://buckstorm:fake-password@stonehill.rmq.cloudamqp.com/buckstorm","http_api_uri":"https://buckstorm:fake-password@stonehill.rmq.cloudamqp.com:1883/api","tags":["rabbitmq"]} }}'