Database versioning

Osgiliath Enterprise Framework facilitate your database migration with the help of Liquibase

Usage

As a reminder, the Model archetype is made of three module: a super one that’s called model, a database one declaring your database and a JPA one declaring your model tables/pojos.

You first have to change the informations of your production database by editing the pom of the model one.

Then, after you’ve developed your model (manually editing jpa entities) and want to update your production db execute ‘mvn clean install -Pdb-data’ to retrieve all data from the production database on a changelog (the resulting xml changelog file will be located on the database module).

Then, you’ve to retrieve the structural difference between your local entities and the production database. Again, execute ‘mvn clean install -Pdb-diff’ on the JPA module to retrieve that structural diff (again on an xml located in the database module).

Then, you’ve to tweak your datas (the first generated changelog) to map with your newer database structure if needed.

Finally, edit the db-changelog.xml of the database module to point to the two precedent xml files and deploy the new feature: your database structure and datas will be updated corresponding to your changes.

Querying all your REST services with Swagger

If you installed the osgiliath-business feature, you’ll have access to an administration console to query your web services.

First, you have to annotate your model element as well as your services with swagger annotations (here is a useful tutorial). You then will have access to the Swagger UI interface via http://<yourhost>:<port>/api-docs. On Swagger UI, you finally have to reference your server URL (i.e. http://localhost:8181/cxf/myServiceServer/api-docs). Be sure to activate the osgiliath-swagger-ui feature in your main feature

Monitoring with Hawtio

You can go to you server url/hawtio to have access to an administration console (usr/pwd karaf), you’ll be able to see your routes, queues, beans, stacks, bundles… Be sure to activate the osgiliath-hawtio feature in your main feature

Comments