Overview
This is a collection of supporting material from the Make you Microservices sing! talk at Oracle Code Sydney on the 18th of July, 2017.
The presentation
The presentation slides are available here.
The code
- MedRec Monolithic Application: WebLogic application on Docker
- Physicians Microservice: Simple NodeJS API on Docker
- Patients Microservice: Simple Java Spring API example with Liquibase on Docker
Prerequisites for running the examples
- At a minimum, you will require
git
,docker
anddocker-compose
to run the examples - Additionally, you may wish to
- install
swagger
to view the API documentation, use the API editor or create codeless mocks for new API operations - install
wercker
to test out the CI/CD job locally before pushing any changes to Wercker
- install
Run the MedRec Monolithic example
- Follow the first two steps here to ensure you have connected to Oracle Container Registry.
- Pull down the Oracle WebLogic Domain image with the command
docker pull container-registry.oracle.com/middleware/weblogic:12.2.1.1
- Checkout the medrec monolithic codebase and navigate to it
git clone https://github.com/craigbarrau/medrec-monolith cd medrec-monolith
- Install WebLogic natively and select the option to include the samples. We need to do this to get access to the MedRec source and distribution files. Sorry about the extra pain but this is the only way to get the sample source code and/or distribution ear files. They are not shared on a public repository by Oracle other than via download of WebLogic from here. You will need an Oracle account to download.
- After installation, copy
medrec.ear
andphysician.ear
from the local WebLogic installation (refered to asORACLE_HOME
) to themedrec-monolith
directory which we previously cloned fromgit
cp $ORACLE_HOME/wlserver/samples/server/medrec/dist/standalone/medrec.ear . cp $ORACLE_HOME/wlserver/samples/server/medrec/dist/standalone/physician.ear .
- Copy
medrec-data-import.jar
andmedrec-domain.jar
to the seed directory. We will need to use these when we seed the data for the MedRec applicationmkdir -p seed cp $ORACLE_HOME/wlserver/samples/server/medrec/dist/modules/medrec-data-import.jar seed/. cp $ORACLE_HOME/wlserver/samples/server/medrec/dist/modules/medrec-domain.jar seed/.
- Navigate ot the
medrec-monolithic
directory and rundocker build -t medrec-monolith .
- Run the
medrec-monolith
container image that we built in the previous stepdocker run -d -p 7001:7001 --name medrec medrec-monolith
Wait for the instance to startup at
http://localhost:7001/medrec
.
We can tail the logs with docker logs -f medrec
. We know it is running when we see a log message like this:
<Jul 19, 2017, 12:23:01,939 AM UTC> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<Jul 19, 2017, 12:23:01,965 AM UTC> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>
Seed the data for our monolithic MedRec application by running the following
docker exec -ti medrec /bin/bash -c "java -classpath \$ORACLE_HOME/seed/medrec-data-import.jar:\$ORACLE_HOME/seed/medrec-domain.jar:\$ORACLE_HOME/wlserver/common/derby/lib/derbyclient.jar:\$ORACLE_HOME/wlserver/server/lib/weblogic.jar com.oracle.medrec.util.DataImporter"
If it is successful we should see the message All the data has been imported successfully!
We can access our application at http://localhost:7001/medrec
Run the MedRec Physicians NodeJS Microservice
- Checkout the Physicians project
git clone https://github.com/craigbarrau/medrec-physicians
- Navigate to the project and start it using
docker-compose
cd medrec-physicians docker-compose up –d
- Test access to the API using
curl http://localhost:10010/physicians
- If you want to test the Swagger definition, try this:
swagger project edit
- If you want to build using
wercker
try this:wercker dev
Run the MedRec Patients Java Spring + Liquibase Microservice
- Checkout the Physicians project
git clone https://github.com/craigbarrau/medrec-patients
- Navigate to the project and start it using
docker-compose
cd medrec-patients docker-compose up –d
- Test access to the API using
curl http://localhost:10011/medrec/patients
Supporting articles
- Topdown Polyglot Microservices with OpenAPI
- Tips and tricks for configuring WebLogic Resources on Docker boot
Related content
Other Resources
-
Want help getting started with Oracle Cloud? Cloud KickStart Datasheet
-
Case Study: Oracle Process Cloud Service (PCS) at Rubicon Red
-
Blog: Uncovering Booking Fraud with PCS and Decision Model Notation (DMN)
-
Blog: Patient Health Monitoring with Internet of Things (IOT) and PCS
Wishlist
- Add documentation on how to edit the projects using Swagger
- Connect the Physicians NodeJS project to MongoDB
- Flesh out the Patients service implementation to the point of completeness. At present, it supports
GET
only - Investigate use of SpringBoot for Patients services
- Add
manifest.json
so the examples can also be deployed to Application Container Cloud Service - Generate the Swagger definition for the Patients codebase to demonstrate the Bottom up approach
- Create Oracle Developer Cloud Service example build process for one of the microservices
- Establish rolling deployment process on Kubernetes with Oracle Compute or Oracle Container Cloud Service
- Link to the corresponding repositories on Apiary.io and Swagger Hub