Skip to content

This is an example demo showing a retail store consisting of several microservices based on JBoss EAP 7, Node.js and Spring Boot, deployed to OpenShift and protected with Red Hat SSO, fronted with a Camel-based API Gateway and aggregator. Optionally includes Jenkins for CI/CD and Hystrix/Turbine for service analytics.

Notifications You must be signed in to change notification settings

haodp/coolstore-microservice

 
 

Repository files navigation

Red Hat Cool Store Microservice Demo

This is an example demo showing a retail store consisting of several of microservices based on JBoss EAP 7 and Node.js, deployed to OpenShift.

It demonstrates how to wire up small microservices into a larger application using microservice architectural principals.

Services

There are several individual microservices and infrastructure components that make up this app:

  1. Catalog Service - Java application running on JBoss Web Server (Tomcat) and MongoDB, serves products and prices for retail products
  2. Cart Service - Java EE application running on JBoss EAP 7, manages shopping cart for each customer
  3. Inventory Service - Java EE application running on JBoss EAP 7 and PostgreSQL, serves inventory and availability data for retail products
  4. Coolstore Gateway - Java EE + Spring Boot + Camel application running on JBoss EAP 7, serving as an entry point/router/aggregator to the backend services
  5. Web UI - A frontend based on AngularJS and PatternFly running in a Node.js container.

Architecture Screenshot

Demo Setup

This demo makes use of OpenShift Source-to-Image process for JBoss EAP, JBoss Web Server and NodeJS. Therefore you need to have an Image Stream defined for each respective builder image. If they are not already available on your OpenShift environment, run the following to create them:

oc login -u system:admin
oc delete -n openshift -f 'https://raw.githubusercontent.com/jboss-openshift/application-templates/master/jboss-image-streams.json'
oc delete -n openshift -f 'https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.3/image-streams/image-streams-rhel7.json'
oc create -n openshift -f 'https://raw.githubusercontent.com/jboss-openshift/application-templates/master/jboss-image-streams.json'
oc create -n openshift -f 'https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/v1.3/image-streams/image-streams-rhel7.json'

Deploy the openshift-templates/coolstore-template.yaml in order to deploy this demo:

oc login -u developer
oc new-project coolstore
oc process -f coolstore-template.yaml | oc create -f -

When all pods are deployed, verify all services are functioning:

oc rsh $(oc get pods -o name -l application=coolstore-gw)
curl http://catalog-service:8080/api/products
curl http://inventory-service:8080/api/availability/329299
curl http://cart-service:8080/api/cart/FOO

Demo Instructions

Access the web interface by pointing your browser at the web-ui route url. Store Screenshot

Notice the UI pods only expose an HTTP endpoint - when users access the UI service through HTTPS, OpenShift handles the TLS termination at the routing layer.

Troubleshooting

  • If you attempt to deploy any of the services, and nothing happens, it may just be taking a while to download the Docker builder images. Visit the OpenShift web console and navigate to Browse->Events and look for errors, and re-run the 'oc delete ; oc create' commands to re-install the images (as outlined at the beginning.)

About

This is an example demo showing a retail store consisting of several microservices based on JBoss EAP 7, Node.js and Spring Boot, deployed to OpenShift and protected with Red Hat SSO, fronted with a Camel-based API Gateway and aggregator. Optionally includes Jenkins for CI/CD and Hystrix/Turbine for service analytics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 72.1%
  • JavaScript 14.4%
  • HTML 7.7%
  • Groovy 5.7%
  • CSS 0.1%