Page History
Configuration
The customerdata service is required by the Customerdata Client component, so when this component is used the following needs to be configured first.
External config location
For supplying configuration from an external location you need to configure the spring.config.additional-location
for the application. See the Config location section for your application platform on the page Installing Runtime.
Database
Scripts to create the required database content are provided for the
following :.
For customers that are upgrading, if the database scheme was already created in a previous version, check to see if there are database upgrade scripts provided for any of the intermediate versions in the Upgrade Instructions
- SQL Server
- Oracle
- H2 (we do not support using a H2 database in production environments)
.
Datasource configuration
For the customerdata service to work, a datasource needs to be configured in blueriq-customerdata-odata-service-v1.yml
. This file is placed in the following folder by the installer: <Blueriq installation folder>\Services\customerdata\conf
.
Code Block | ||||
---|---|---|---|---|
| ||||
####################################################################### ## datasource configuration ## ####################################################################### blueriq: customerdata: datasource: customer-data-sql-store: url: <url> username: <username> password: <password> driver-class-name: org.h2.Driver<driver-class> validation-query: SELECT 1<validation-query> testWhileIdle: true timeBetweenEvictionRunsMillis: 5000 defaultQueryTimeoutSeconds: 10 ####################################################################### ## Security configuration hibernate: dialect: <dialect> hbm2ddl: auto: validate id: new_generator_mappings: true show_sql: false use_nationalized_character_data: true |
Example configuration
Below are configuration examples which contain a JDBC url, driver-class, validation query and dialect for each supported database.
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq: customerdata: datasource: customer-data-sql-store: url: jdbc:oracle:thin:@<host>:<port>/<servicename> username: <username> password: <password> ## ## driver-class-name: oracle.jdbc.driver.OracleDriver validation-query: SELECT 1 FROM DUAL testWhileIdle: true timeBetweenEvictionRunsMillis: 5000 defaultQueryTimeoutSeconds: 10 hibernate: dialect: org.hibernate.dialect.OracleDialect hbm2ddl: auto: validate id: new_generator_mappings: true show_sql: false use_nationalized_character_data: true |
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq: customerdata: datasource: ## ## Here you can override the default username/passwordcustomer-data-sql-store: url: jdbc:sqlserver://<host>:<port>;databaseName=<database>;trustServerCertificate=true username: <username> ## ####################################################################### spring: security: password: <password> driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver validation-query: SELECT 1 user testWhileIdle: true nametimeBetweenEvictionRunsMillis: <username>5000 password defaultQueryTimeoutSeconds: '{noop}<password>' 10 hibernate: dialect: org.hibernate.dialect.H2DialectSQLServer2012Dialect hbm2ddl: auto: validate id: new_generator_mappings: true show_sql: false use_nationalized_character_data: true |
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq:
customerdata:
datasource:
customer-data-sql-store:
url: jdbc:postgresql://<host>:<port>/<database>
username: <username>
password: <password>
driver-class-name: org.postgresql.Driver
validation-query: SELECT 1
testWhileIdle: true
timeBetweenEvictionRunsMillis: 5000
defaultQueryTimeoutSeconds: 10
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
hbm2ddl:
auto: validate
id:
new_generator_mappings: true
show_sql: false
use_nationalized_character_data: true | ||||
Note | ||||
We recommend setting a validation query so that when a database connection is lost due to a network failure for instance, it can be recovered once the network is restored. The validation query is database specific, the query below works with SQL Server (and H2), for Oracle use SELECT 1 FROM DUAL . For more information on configuring datasources, see How to configure BasicDataSource Configuration Parameters. |
Database query timeout
To specify database query timeout, in blueriq-customerdata-odata-service-v1.yml, set defaultQueryTimeoutSeconds
property under specified datasource.
If multi-tenancy enabled, when needed, the value has to be set for each datasource separately.
Without setting property, the default value is 60 seconds.
Example
For *.yml see example for customer-data-sql-store
datasource above
For *.properties type file:
codeblueriq.customerdata.datasource.customer-data-sql-store.defaultQueryTimeoutSeconds=10 |
Info |
---|
For additional datasource configuration please see the #DATASOURCE section in the Spring property documentation |
Supported dialects:
- org.hibernate.dialect.SQLServer2012Dialect (for SQL Server)
- org.hibernate.dialect.Oracle12cDialect (for Oracle)
- org.hibernate.dialect.H2Dialect (for H2) (we do not support using a H2 database in production environments)
Supported hbm2ddl.auto values:
- none
- validate
Warning |
---|
For production systems, we strongly recommend to set this setting to When using H2, which is not suitable for production environments, the |
refer to the Spring property documentation. |
JNDI
If you would like to use JNDI to configure your datasource, replace the blueriq.customerdata.datasource
section in the blueriq-customerdata-odata-service-v1.yml
described above with the following:
Please note that when JNDI is your preferred resource configuration, the Customerdata Service needs differently named JNDI resources for the customer-sql-store on the one hand, and the entity-event-manager on the other hand.
Code Block |
---|
blueriq: customerdata: datasource: customerdata-sql-store: jndi-name: java:jboss/datasources/myCustomerdataSqlStoreJndiName |
Database drivers
Depending on the underlying database, a specific driver needs to be installed on the application server as described on Configuring JDBC database drivers.
Case Insensitive searching for oracle
For MSSQL searching through case data is case insensitive by default. The default collation for Oracle is Oracle and PostgreSQL are case sensitive and because of that searching in Case Data is case sensitive.
For Oracle we We created the possibility to enable case insensitive searching on these case sensitive databases, for more information how to enable it see: How to enable case insensitive search on case data for Oracle & PostgreSQL.
The feature toggle has to be set to true to enable this feature.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
blueriq: customerdata: oracle: case-insensitive-search-enabled: true |
The case-insensitive search works on filtering text fields in aggregate lists, and using the "like" operator in searches.
Endpoint per aggregate type
It is possible to have different endpoints per aggregate type. In the schematic overview below is shown how having multiple endpoints per aggregate looks like. The
Include Page | ||||
---|---|---|---|---|
|
Include Page_PropertiesFileJava _PropertiesFileJava
_PropertiesFileJava | |
_PropertiesFileJava |
The following properties need to be set in the
Include Page | ||||
---|---|---|---|---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
# Mandatory = default connection for every aggregate that does not have a custom connection blueriq.customerdata-client.url=http://localhost:10097/customerdata/api/v1 blueriq.customerdata-client.username=blueriq blueriq.customerdata-client.password=welcome # Optional - Custom connection(s) per aggregate type blueriq.customerdata-client.type.employee.url=http://localhost:20097/customerdata/api/v1 blueriq.customerdata-client.type.employee.username=blueriq blueriq.customerdata-client.type.employee.password=welcome blueriq.customerdata-client.type.departement.url=http://localhost:30097/customerdata/api/v1 blueriq.customerdata-client.type.departement.username=blueriq blueriq.customerdata-client.type.departement.password=welcome |
Note |
---|
The properties above contain the default settings, which are set by the Installer. If afterwards these settings are customized in the customerdata service they need to be changed in the Runtime as well. |