Giter Club home page Giter Club logo

orders-service's Introduction

Orders Service Example

This is a sample service adapted from the ticket monster app.

Build and run locally

mvn clean install

Call it here:

curl -v -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{"ticketRequests":[{"ticketPriceGuideId":1,"quantity":1}],"email":"[email protected]","performance":1,"performanceName":"Rock concert of the decade at Roy Thomson Hall"}'  http://localhost:8080/orders/bookings
mvn wildfly-swarm:run

Running with a MySQL backend:

mvn clean package -Pmysql

Bootstrap the databases

We need to refer to the mysql database template from https://github.com/christian-posta/ticket-monster-infra. We can install the template with:

oc create -f mysql-openshift-template.yml

Now let's create the mysql database for the admin microservice:

oc process ticket-monster-mysql -v DATABASE_SERVICE_NAME=mysqlorders | oc create -f -
oc deploy mysqlorders --latest

Liquibase commands

As root, we can reset the database:

mysql> drop database ticketmonster; create database ticketmonster;
mvn -Pdb-migration-mysql liquibase:update
mvn -Pdb-migration-mysql liquibase:updateSQL
mvn -Pdb-migration-mysql liquibase:status
mvn -Pdb-migration-mysql liquibase:tag -Dliquibase.tag=v2.0

Automatically discover diffs between the existing schema and what Hibernate sees currently

mvn -Pdb-migration-mysql liquibase:diff -Dliquibase.referenceUrl=hibernate:ejb3:primary

Generate the changeLog to a file:

mvn -Pmysql,db-migration-mysql liquibase:diff -Dliquibase.referenceUrl=hibernate:ejb3:primary -Dliquibase.diffChangeLogFile=target/changes.yml

From here you can evaluate what changes should go into the next update

After an update, it's recommended to tag if things went successful, or rollback if not.

Also, you can see what tags exist in the DB:

select ID, DATEEXECUTED,TAG from DATABASECHANGELOG WHERE TAG IS NOT NULL ORDER BY DATEEXECUTED;

TODO: eliminate sending back data model elements directly; we should make more clearly the "view" model and the "write" model .. this will involve cleaning up the DTO objects if they're not needed in the write model

orders-service's People

Contributors

pushpak51094 avatar christian-posta avatar gogsadmin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.