spring-projects/spring-xd — pull request #430 by cppwfs (2013-11-25 15:25:10+00:00)
Title: XD-1012 User configurable batch jdbc settings

* Added feature where HSQLDB will not start if HSQL is not chosen for batch store.

* Updated the tests to support the hsqldb profile.

* Updated application.yml to support redis & Rabbit

* Updated build.gradle to copy application.yml to the config directory as a template

* Removed redis.properties and rabbit.properties These have been replaced by the settings in application.yml

Below are the instruction on setting up a remote job repo, rabbit or redis.

=== Application configuration
In the XD_HOME/config directory you will see a application.template file. This file
contains all the property settings for a default XD deployment.

* Rename the application.template to application.yml.
* Edit application.yml

==== Setting up the Job Repository database

XD saves the state of the jobs in a relational database. By default XD starts an embedded
HSQLDB. The HSQLDB should only be used for development and a learning. But when it comes
time to deploy to production, you will need to select another database. XD has only been
tested on 3 databases: HSQLDB, MySql and Postgres.

===== Setting up Job Repository
In the application.yml file update the datasource:url, username, password, driverClassName to the database you have setup to store job information.
```yaml
url:
username:
password:
driverClassName:
```
When you start the xd-admin, XD will automatically create and initialize the tables necessary to store job information.

* Set the profile to use the correct database type. The valid types are hsqldb, mysql, postgres.
In the example below we see that hsqldb is the active profile.

```
spring:
profiles:
active: default,hsqldb
```

===== Setting Redis to connect to remote instance
When you are running in distributed mode where the admin server or containers are on different machines than the Redis server, we need to configure XD to reference the redis instance. So in the application.yml file update the redis with appropriate host and port.

```
---
spring:
data:
redis:
port: 6379
host: localhost
```

===== Setting XD to connect to remote rabbit instance

When you are running in distributed mode where the admin server or containers are on different machines than the Rabbit server, we need to configure XD to reference the rabbit instance. So in the application.yml file update the rabbit settings with appropriate host and port.

```
---
spring:
rabbitmq:
host: ${vcap.services.rabbitmq.credentials.hostname:localhost}
port: ${vcap.services.rabbitmq.credentials.port:5672}
username: ${vcap.services.rabbitmq.credentials.username:guest}
password: ${vcap.services.rabbitmq.credentials.password:guest}
virtual_host: ${vcap.services.rabbitmq.credentials.vhost:/}
```