You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

WORK IN PROGRESS

This page applies to you when you want a different data storage for the persistence-API than the default which is provided in the Customerdata service

The default implementation for the persistence-API is the Customerdata service. This page provides information about implementing a custom data storage for the Customerdata service by extending the existing Customerdata service. This is suitable in case of an different database or different database scheme.

Please note that the Customerdata service is written in Java and Spring. Because of this extending the Customerdata Service with custom implementation also requires you to use Java and Spring. Also maven is used as build tool.

Custom components

 

For creating this custom data store implementation two components of the existing Customerdata service need to be replaced with a custom implementation.

  • blueriq-customerdata-sql-store-service → custom data store implementation
  • blueriq-customerdata-sql-store-application → custom War application

 

blueriq-customerdata-sql-store-service

The blueriq-customerdata-sql-store-service is a Hibernate implementation which stores the data in the database. For storing the data in a different database or different data structure you need to replace this part with your own implementation which handles the data storage using blueriq-customerdata-api-v1.

blueriq-customerdata-sql-store-application

The blueriq-customerdata-sql-store-application packages a war file for deployment on a application server. When you create a custom data store implementation you need to package a new war containing the needed components(see: Custom war implementation).

 

// TODO JAVADOC of the api on confluence (warning)

blueriq-customerdata-api-v1

When you are implementing a custom data store you need to implement some interfaces from the blueriq-customerdata-api-v1 and use the model classes of the api-v1.

The blueriq-customerdata-api-v1 consists out of the following packages:

  • com.blueriq.customerdata.api.v1.event
  • com.blueriq.customerdata.api.v1.exception
  • com.blueriq.customerdata.api.v1.expression
  • com.blueriq.customerdata.api.v1.model
  • com.blueriq.customerdata.api.v1.model.event
  • com.blueriq.customerdata.api.v1.order
  • com.blueriq.customerdata.api.v1.repository
  • com.blueriq.customerdata.api.v1.select

Packages com.blueriq.customerdata.api.v1.event and com.blueriq.customerdata.api.v1.model.event are not needed for a custom data store implementation.

The following packages are needed for filtering, ordering and selecting data: com.blueriq.customerdata.api.v1.expression, com.blueriq.customerdata.api.v1.order and com.blueriq.customerdata.api.v1.select.

In the com.blueriq.customerdata.api.v1.repository package you will find the interface needed retrieving, storing and deleting the data using the expression, model, order and select packages as input. The model package is also used as return results for some operations. for more information see: LINK.

// TODO: describe what is put on the queue (AggregateModel is still published on the queue, refer to queue documentation)

Creating a custom data store implementation

// TODO describe whats needed with example

Create your own implementation for the data-storage

replace the sql-store implementation:

- how is it picked up? (config/component scan)

- transactionManager:

  • must be of type platformTransactionManager

-- cannot have the name's 'chainedTransactionManager' OR 'rabbitTransactionManager' because these names are reserved.

-- Also you need to provide the correct Order precedence. We advise you to use @Order(10) // DatabaseTransaction is higher in order than the RabbitTransaction in the transactionChain

-- describe why the order needs to be higher

Creating a custom war implementation

// TODO describe whats needed for packaging a war file

- jboss-web

Example Maven structure with example project

// TODO

Test

// TODO

How do people verify that their custom implementation does work the same as ours?
do we want to deliver our regression-test so customers can see if the behavior is the same?

  • No labels