SlideShare a Scribd company logo
1 of 78
David Renton
Creating a
Microservices Chassis
David Renton
The problem:
cross-cutting concerns
• Logging
• Metric reporting and instrumentation
• Fault tolerance (a-la Hystrix)
• Error reporting
• Tracing (especially through multiple services)
• Defaults for everything (how to build a project, run, test, format
code, etc.)
David Renton
Today we will build and deploy a
reproducible Microservices stack
This could be used as a chassis for
future microservices development
David Renton
Considered Frameworks
Gizmo Microservice
Toolkit Finagle
Spring Boot and
Spring Cloud
David Renton
David Renton
JHipster is a development platform to
generate, develop and deploy
Spring Boot + Angular/React
Web applications and Spring microservices.
David Renton
Building blocks for the day
David Renton
Install required software
David Renton
Install required software
Create a local registry
David Renton
Install required software
Create microservices
Create a local registry
David Renton
Install required software
Create microservices
Create a local registry
Test locally
David Renton
Install required software
Create microservices
Create a local registry Set up cloud registry
Test locally
David Renton
Install required software
Create microservices
Create a local registry
Deploy to the cloud
Set up cloud registry
Test locally
David Renton
Prerequisites
We will use Vagrant to spin up a VM preconfigured to develop JHipster
applications.
David Renton
Install Vagrant
Open a web browser and navigate to:
https://www.vagrantup.com/downloads.html
David Renton
Install Virtual Box
Open a web browser and navigate to:
https://www.virtualbox.org/wiki/Downloads
David Renton
Install the Dev Box
Full instructions here: https://github.com/jhipster/jhipster-devbox
But the following will get us started:
On Mac or Linux
vagrant init jhipster/jhipster-devbox; vagrant up --provider virtualbox
On Windows
vagrant init jhipster/jhipster-devbox
vagrant up --provider virtualbox
David Renton
While that’s installing ….
Have a look through some of the options available through JHipster
David Renton
David Renton
David Renton
David Renton
David Renton
Make a folder to work in
Mine is /var/tmp/NeuedaProject
git clone https://github.com/jhipster/jhipster-registry
Inside that folder - clone the JHipster registry RUN: (Use GitBash)
David Renton
git init
git add .
git commit –m
“meaningful
message”
When you see the “In case of
fire” symbol again you should
be versioning your code.
David Renton
Enter the cloned project
Run the back end - RUN:
cd jhipster-registry && ./mvnw
DIRECTION leave this window open
David Renton
In the cloned project
Build the front end- RUN:
cd jhipster-registry && yarn && yarn start
DIRECTION when the build is finished, you can close this window
David Renton
View the registry
• Restart the back end to pick up the yarn build.
• Open a browser and navigate to:
http://localhost:8761
David Renton
David Renton
Milestone – running Jhipster registry
The JHipster Registry has three main purposes:
• It is a an Eureka server, that serves as a discovery server for
applications. This is how JHipster handles routing, load balancing
and scalability for all applications.
• It is a Spring Cloud Config server, that provide runtime
configuration to all applications.
• It is an administration server, with dashboards to monitor and
manage applications.
David Renton
Creating a Microservice
Create a directory for the app and cd to it - RUN:
mkdir car-app && cd car-app
David Renton
Run the JHipster wizard
Chose whichever options suit you best, the only caveat’s are:
The port should be 8081
The production database needs to be PostgreSQL
jhipster
In the CMD window in the car-app directory - RUN
David Renton
Here are the options I chose:? Which *type* of application would you like to create? Microservice application
? What is the base name of your application? carsapp
? As you are running in a microservicearchitecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081
? What is your default Java package name? com.car.app
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use?
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install Portuguese (Brazilian)
? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling
? Would you like to install other generators from the JHipster Marketplace? No
David Renton
Create an entity
I gave the entity 3 fields:
• make
• model
• price
jhipster entity car
In the same window and directory (car-app) RUN:
David Renton
Here are the options I chose:? Do you want to add a field to your entity? Yes
? What is the name of your field? make
? What is the type of your field? String
? Do you want to add validation rules to your field? Yes
? Which validation rules do you want to add? Required
? Do you want to add a field to your entity? Yes
? What is the name of your field? model
? What is the type of your field? String
? Do you want to add validation rules to your field? Yes
? Which validation rules do you want to add? Required
? Do you want to add a field to your entity? Yes
? What is the name of your field? price
? What is the type of your field? BigDecimal
? Do you want to add validation rules to your field? Yes
? Which validation rules do you want to add? Required
? Do you want to add a field to your entity? No
? Do you want to add a relationship to another entity? No
? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly
? Do you want pagination on your entity? Yes, with infinite scroll
David Renton
Run the app
Keep an eye on your registry dashboard to see the microservice registration.
./mvnw
In the same window and directory (car-app) RUN:
David Renton
See the microservice starting
• We should see the app starting it the registry logs at
On the dashboard or
http://localhost:8761/#/logs
NOTE: there is no front end code
yet, inspecting the files we will find
no html/css
David Renton
Milestone
• You have created a microservice and registered it in your local
Eureka server.
David Renton
Creating a Gateway
Create a directory for the app and cd to it - RUN:
cd .. && mkdir gateway-app && cd gateway-app
David Renton
Run the JHipster wizard
Chose whichever options suit you best, the only caveat’s are:
The port should be 8080
The production database needs to be PostgreSQL
jhipster
In the CMD window in the gateway directory - RUN
David Renton
Here are the options I chose:? Which *type* of application would you like to create? Microservice gateway
? What is the base name of your application? gateway
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080
? What is your default Java package name? com.gateway.app
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? React
? Would you like to enable *SASS* stylesheet preprocessor? No
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install Portuguese (Brazilian)
? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling, Protractor
? Would you like to install other generators from the JHipster Marketplace? No
David Renton
Add the entity created earlier
jhipster entity car
In the same window and directory (gateway-app) RUN:
David Renton
Here are the options I chose:
? Do you want to generate this entity from an existing microservice? Yes
? Enter the path to the microservice root directory: ../car-app
? Do you want to update the entity? This will replace the existing files for this
entity, all your custom code will be overwritten Yes, re generate the entity
conflict webpackwebpack.dev.js
David Renton
Run the app
Keep an eye on your registry to see the gateway being registered and its
status
Automatically generated credentials are admin/admin and user/user
./mvnw
In the same window and directory (gateway-app) RUN:
David Renton
View the microservice through the
gateway
• To see the updated project navigate to:
http://localhost:8080/
Login with Admin/Admin
Navigate to entitys/car and
create a new car
David Renton
Test
• To do a test of functionality, do a:
• View
• Edit
• Delete
• Recreate a car
Check
http://localhost:8761/#/applications
David Renton
David Renton
Milestone
You have created a front end that can read and write data to your
microservice all registered through your local Eureka server.
David Renton
A second Microservice
Create a directory for the app and cd to it - RUN:
cd .. && mkdir dealer-app && cd dealer-app
David Renton
Run the JHipster wizard
Chose whichever options suit you best, the only caveat’s are:
The port should be 8082
The production database needs to be PostgreSQL
jhipster
In the CMD window in the dealer-app directory - RUN
David Renton
Here are the options I chose:? Which *type* of application would you like to create? Microservice application
? What is the base name of your application? dealerapp
? As you are running in a microservicearchitecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8082
? What is your default Java package name? com.dealer.app
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with disk-based persistence
? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which other technologies would you like to use?
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install Portuguese (Brazilian)
? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling
? Would you like to install other generators from the JHipster Marketplace? No
David Renton
Create an entity
I gave the entity 2 fields:
• name
• address
jhipster entity dealer
In the same window and directory (car-app) RUN:
David Renton
Here are the options I chose:
? Do you want to add a field to your entity? Yes
? What is the name of your field? name
? What is the type of your field? String
? Do you want to add validation rules to your field? Yes
? Which validation rules do you want to add? Required
? Do you want to add a field to your entity? Yes
? What is the name of your field? address
? What is the type of your field? String
? Do you want to add validation rules to your field? Yes
? Which validation rules do you want to add? Required
? Do you want to add a field to your entity? No
? Do you want to add a relationship to another entity? No
? Do you want to use separate service class for your business logic? No, the REST controller should use the
repository directly
? Do you want pagination on your entity? Yes, with infinite scroll
David Renton
Run the app
./mvnw
In the same window and directory (dealer-app) RUN:
David Renton
Add entity to the gateway
jhipster entity dealer
In the same window navigate to the gateway-app directory (cd ../gateway-app)
RUN:
David Renton
Here are the options I chose:
? Do you want to generate this entity from an existing microservice? Yes
? Enter the path to the microservice root directory: ../dealer-app
? Do you want to update the entity? This will replace the existing files for this
entity, all your custom code will be overwritten Yes, re generate the entity
conflict webpackwebpack.dev.js
David Renton
Run the app
Automatically generated credentials are admin/admin and user/user
./mvnw
In the same window and directory (gateway-app) RUN:
David Renton
Check the microservice through the
gateway
• To see the updated project navigate to:
http://localhost:8080/
Login with Admin/Admin
Navigate to entitys/car and
create a new car
David Renton
Test
• To do a test of functionality, do a:
• View
• Edit
• Delete
• Recreate a dealer
Check
http://localhost:8761/#/applications
David Renton
David Renton
Milestone
• You have created a second microservice and attached it to an
already running gateway.
David Renton
Test automation
• Depending on the tests you included in your selections
• Jhipster has built them for you and stored them in the test folder
• run them!!
./mvnw clean test
gulp test
npm run e2e
David Renton
Code Quality
Run the Sonar Docker container at the root of your project
Login to Sonar with admin/admin at:
Run a build and pipe the results to Sonar
./mvnw -Pprod clean test sonar:sonar
http://127.0.0.1:9001/
docker-compose -f src/main/docker/sonar.yml up –d
http://127.0.0.1:9001/
David Renton
Deploy
You must create a Heroku account
heroku.com
David Renton
What is Heroku
• Heroku is a cloud platform that lets companies build, deliver,
monitor and scale apps — we're the fastest way to go from idea to
URL, bypassing all those infrastructure headaches.
• Heroku, one of the first cloud platforms, has been in development
since June 2007
• Heroku was acquired by Salesforce.com in 2010 for $212 million
• Heroku gives us free credits, allowing us to test generated
applications with complex, high-end setups, to guarantee
everything works well for our common users
David Renton
Heroku JHipster registry
https://dashboard.heroku.com/new?&template=https%3A%2F%2Fgithub.co
m%2Fjhipster%2Fjhipster-registry
Open a browser and navigate to:
This is a special link that lets Heroku know you are using Jhipster
microservices and will need a Jhipster registry the same as your local one.
David Renton
Here are the options I chose:
I've used the name neueda and the region as Europe
Then deploy app
The registry address will be https://[appname].herokuapp.com so in my case
the address will be https://neueda.herokuapp.com.
David Renton
Open the
projects in an IDE
Change the address of the registry in the:
application-prod.yml
bootstrap-prod.yml
Src-main-resource-config
David Renton
Open the projects in an IDE
The registry address will be https://[appname].herokuapp.com so in my case
the address will be https://neueda.herokuapp.com.
uri: http://admin:${jhipster.registry.password}@neueda.herokuapp.com/config
hostname: https://admin:admin@neueda.herokuapp.com
David Renton
Heroku CLI
heroku login
Log in with the CLI by running the following command RUN:
**$ heroku login**
Enter your Heroku credentials.
Email: YOUR_EMAIL
Password (typing will be hidden): YOUR_PASSWORD
Authentication successful.
David Renton
Deploy your app to Heroku
Jhipster heroku
Navigate to each folder, gateway-app, car-app and dealer-app and RUN:
The Heroku sub-generator will prompt you for the URL of your registry, which
will be in the form https://[appname].herokuapp.com
In my case the address will be https://neueda.herokuapp.com.
Always allow Heroku to pick a name for your deployment.
David Renton
Deploy your app to Heroku
jhipster heroku
? Name to deploy as: gateway
? On which region do you want to deploy ? us
? Which type of deployment do you want ? Git (compile on Heroku)
? The Heroku app "gateway" already exists! Use it anyways? No, generate a random
name
https://damp-crag-59450.herokuapp.com/ | https://git.heroku.com/damp-crag-
59450.git
? What is the name of your JHipster Registry Heroku app? neueda
? What is your JHipster Registry username? admin
? What is your JHipster Registry password? admin
JHIPSTER_REGISTRY_URL: https://admin:admin@neueda.herokuapp.com
David Renton
Check the cloud logs for
progress
David Renton
Heroku tips
If the worst happens:
Delete the application-heroku-yml and bootstrap-heroku.yml
Then in .yo.rc.json remove the “herokuAppName”
Make sure the value for herokuDeployType is git
David Renton
Redeploy your app to Heroku
Jhipster heroku
After making modifications to the source
David Renton
Heroku tips 2
David Renton
CI/CD
JHipster should support the following CI systems out of the box:
Jenkins:
Setting up Jenkins 1
Setting up Jenkins 2 (recommended)
Travis: refer to the Travis Documentation
GitLab CI: refer to the GitLab CI Documentation
Azure Pipelines: refer to the Azure Pipelines Documentation
Running the sub-generator
To generate these config files, run this command in your project folder:
jhipster ci-cd
Then answer all the questions.
David Renton
What pipeline do you want?
The CI/CD pipeline you want to generate:
Jenkins pipeline
Azure Pipelines
GitLab CI
Travis CI
Note: when you select Jenkins pipeline, a new src/main/docker/jenkins.yml file
will be generated. So you can test Jenkins locally by running:
docker-compose -f src/main/docker/jenkins.yml up -d
David Renton

More Related Content

What's hot

Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaAraf Karsh Hamid
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
8. Event Storming (P. Rayner).pdf
8. Event Storming (P. Rayner).pdf8. Event Storming (P. Rayner).pdf
8. Event Storming (P. Rayner).pdfMikhail Andronov
 
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservicesAndrew Schofield
 
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...HostedbyConfluent
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactAraf Karsh Hamid
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)Tom Kocjan
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesRadosław Maziarka
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Process Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process AutomationProcess Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process AutomationBernd Ruecker
 
Jira & Ansible: Streamlining Jira Server Administration for the Enterprise
Jira & Ansible: Streamlining Jira Server Administration for the EnterpriseJira & Ansible: Streamlining Jira Server Administration for the Enterprise
Jira & Ansible: Streamlining Jira Server Administration for the EnterpriseAtlassian
 

What's hot (20)

Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
8. Event Storming (P. Rayner).pdf
8. Event Storming (P. Rayner).pdf8. Event Storming (P. Rayner).pdf
8. Event Storming (P. Rayner).pdf
 
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservices
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Event storming recipes
Event storming recipesEvent storming recipes
Event storming recipes
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Event Storming and Saga
Event Storming and SagaEvent Storming and Saga
Event Storming and Saga
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Microservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito PactMicroservices Testing Strategies JUnit Cucumber Mockito Pact
Microservices Testing Strategies JUnit Cucumber Mockito Pact
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
Domain Driven Design
Domain Driven Design Domain Driven Design
Domain Driven Design
 
Domain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and MicroservicesDomain Driven Design - Strategic Patterns and Microservices
Domain Driven Design - Strategic Patterns and Microservices
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Process Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process AutomationProcess Automation Forum April 2021 - Practical Process Automation
Process Automation Forum April 2021 - Practical Process Automation
 
Jira & Ansible: Streamlining Jira Server Administration for the Enterprise
Jira & Ansible: Streamlining Jira Server Administration for the EnterpriseJira & Ansible: Streamlining Jira Server Administration for the Enterprise
Jira & Ansible: Streamlining Jira Server Administration for the Enterprise
 
Serverless
ServerlessServerless
Serverless
 

Similar to Microservices chassis

GCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native ArchitecturesGCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native Architecturesnine
 
Cloud-native Patterns
Cloud-native PatternsCloud-native Patterns
Cloud-native PatternsVMware Tanzu
 
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Alexandre Roman
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)VMware Tanzu
 
WebFest 2011 Hosting Applications CR by David Tang
WebFest 2011 Hosting Applications CR by David TangWebFest 2011 Hosting Applications CR by David Tang
WebFest 2011 Hosting Applications CR by David TangSpiffy
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native BootcampVMware Tanzu
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoiceIsaac Christoffersen
 
The Twelve Factor App
The Twelve Factor AppThe Twelve Factor App
The Twelve Factor AppPablo Fullana
 
Backstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBackstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBrandenTimm1
 
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...WSPDC & FEDSPUG
 
Enterprise DevOps Series: Using VS Code & Zowe
Enterprise DevOps Series: Using VS Code & ZoweEnterprise DevOps Series: Using VS Code & Zowe
Enterprise DevOps Series: Using VS Code & ZoweDevOps.com
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...SAP Cloud Platform
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsAmazon Web Services
 
SLUGUK BUILD Round-up
SLUGUK BUILD Round-upSLUGUK BUILD Round-up
SLUGUK BUILD Round-upDerek Lakin
 
SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumit Kataria
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)Brian Culver
 
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...Amazon Web Services
 

Similar to Microservices chassis (20)

GCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native ArchitecturesGCP Meetup #3 - Approaches to Cloud Native Architectures
GCP Meetup #3 - Approaches to Cloud Native Architectures
 
Cloud-native Patterns
Cloud-native PatternsCloud-native Patterns
Cloud-native Patterns
 
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)
 
Balaji Resume
Balaji ResumeBalaji Resume
Balaji Resume
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
 
WebFest 2011 Hosting Applications CR by David Tang
WebFest 2011 Hosting Applications CR by David TangWebFest 2011 Hosting Applications CR by David Tang
WebFest 2011 Hosting Applications CR by David Tang
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of ChoicePaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
 
The Twelve Factor App
The Twelve Factor AppThe Twelve Factor App
The Twelve Factor App
 
Backstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBackstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptx
 
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
 
Enterprise DevOps Series: Using VS Code & Zowe
Enterprise DevOps Series: Using VS Code & ZoweEnterprise DevOps Series: Using VS Code & Zowe
Enterprise DevOps Series: Using VS Code & Zowe
 
Kunal bhatia resume mass
Kunal bhatia   resume massKunal bhatia   resume mass
Kunal bhatia resume mass
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
SLUGUK BUILD Round-up
SLUGUK BUILD Round-upSLUGUK BUILD Round-up
SLUGUK BUILD Round-up
 
SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststem
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
From Monolith to Microservices (And All the Bumps along the Way) (CON360-R1) ...
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Microservices chassis

  • 2. David Renton The problem: cross-cutting concerns • Logging • Metric reporting and instrumentation • Fault tolerance (a-la Hystrix) • Error reporting • Tracing (especially through multiple services) • Defaults for everything (how to build a project, run, test, format code, etc.)
  • 3. David Renton Today we will build and deploy a reproducible Microservices stack This could be used as a chassis for future microservices development
  • 4. David Renton Considered Frameworks Gizmo Microservice Toolkit Finagle Spring Boot and Spring Cloud
  • 6. David Renton JHipster is a development platform to generate, develop and deploy Spring Boot + Angular/React Web applications and Spring microservices.
  • 9. David Renton Install required software Create a local registry
  • 10. David Renton Install required software Create microservices Create a local registry
  • 11. David Renton Install required software Create microservices Create a local registry Test locally
  • 12. David Renton Install required software Create microservices Create a local registry Set up cloud registry Test locally
  • 13. David Renton Install required software Create microservices Create a local registry Deploy to the cloud Set up cloud registry Test locally
  • 14. David Renton Prerequisites We will use Vagrant to spin up a VM preconfigured to develop JHipster applications.
  • 15. David Renton Install Vagrant Open a web browser and navigate to: https://www.vagrantup.com/downloads.html
  • 16. David Renton Install Virtual Box Open a web browser and navigate to: https://www.virtualbox.org/wiki/Downloads
  • 17. David Renton Install the Dev Box Full instructions here: https://github.com/jhipster/jhipster-devbox But the following will get us started: On Mac or Linux vagrant init jhipster/jhipster-devbox; vagrant up --provider virtualbox On Windows vagrant init jhipster/jhipster-devbox vagrant up --provider virtualbox
  • 18. David Renton While that’s installing …. Have a look through some of the options available through JHipster
  • 23. David Renton Make a folder to work in Mine is /var/tmp/NeuedaProject git clone https://github.com/jhipster/jhipster-registry Inside that folder - clone the JHipster registry RUN: (Use GitBash)
  • 24. David Renton git init git add . git commit –m “meaningful message” When you see the “In case of fire” symbol again you should be versioning your code.
  • 25. David Renton Enter the cloned project Run the back end - RUN: cd jhipster-registry && ./mvnw DIRECTION leave this window open
  • 26. David Renton In the cloned project Build the front end- RUN: cd jhipster-registry && yarn && yarn start DIRECTION when the build is finished, you can close this window
  • 27. David Renton View the registry • Restart the back end to pick up the yarn build. • Open a browser and navigate to: http://localhost:8761
  • 29. David Renton Milestone – running Jhipster registry The JHipster Registry has three main purposes: • It is a an Eureka server, that serves as a discovery server for applications. This is how JHipster handles routing, load balancing and scalability for all applications. • It is a Spring Cloud Config server, that provide runtime configuration to all applications. • It is an administration server, with dashboards to monitor and manage applications.
  • 30. David Renton Creating a Microservice Create a directory for the app and cd to it - RUN: mkdir car-app && cd car-app
  • 31. David Renton Run the JHipster wizard Chose whichever options suit you best, the only caveat’s are: The port should be 8081 The production database needs to be PostgreSQL jhipster In the CMD window in the car-app directory - RUN
  • 32. David Renton Here are the options I chose:? Which *type* of application would you like to create? Microservice application ? What is the base name of your application? carsapp ? As you are running in a microservicearchitecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081 ? What is your default Java package name? com.car.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes) ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling ? Would you like to install other generators from the JHipster Marketplace? No
  • 33. David Renton Create an entity I gave the entity 3 fields: • make • model • price jhipster entity car In the same window and directory (car-app) RUN:
  • 34. David Renton Here are the options I chose:? Do you want to add a field to your entity? Yes ? What is the name of your field? make ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? model ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? price ? What is the type of your field? BigDecimal ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? No ? Do you want to add a relationship to another entity? No ? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly ? Do you want pagination on your entity? Yes, with infinite scroll
  • 35. David Renton Run the app Keep an eye on your registry dashboard to see the microservice registration. ./mvnw In the same window and directory (car-app) RUN:
  • 36. David Renton See the microservice starting • We should see the app starting it the registry logs at On the dashboard or http://localhost:8761/#/logs NOTE: there is no front end code yet, inspecting the files we will find no html/css
  • 37. David Renton Milestone • You have created a microservice and registered it in your local Eureka server.
  • 38. David Renton Creating a Gateway Create a directory for the app and cd to it - RUN: cd .. && mkdir gateway-app && cd gateway-app
  • 39. David Renton Run the JHipster wizard Chose whichever options suit you best, the only caveat’s are: The port should be 8080 The production database needs to be PostgreSQL jhipster In the CMD window in the gateway directory - RUN
  • 40. David Renton Here are the options I chose:? Which *type* of application would you like to create? Microservice gateway ? What is the base name of your application? gateway ? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080 ? What is your default Java package name? com.gateway.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Which *Framework* would you like to use for the client? React ? Would you like to enable *SASS* stylesheet preprocessor? No ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling, Protractor ? Would you like to install other generators from the JHipster Marketplace? No
  • 41. David Renton Add the entity created earlier jhipster entity car In the same window and directory (gateway-app) RUN:
  • 42. David Renton Here are the options I chose: ? Do you want to generate this entity from an existing microservice? Yes ? Enter the path to the microservice root directory: ../car-app ? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity conflict webpackwebpack.dev.js
  • 43. David Renton Run the app Keep an eye on your registry to see the gateway being registered and its status Automatically generated credentials are admin/admin and user/user ./mvnw In the same window and directory (gateway-app) RUN:
  • 44. David Renton View the microservice through the gateway • To see the updated project navigate to: http://localhost:8080/ Login with Admin/Admin Navigate to entitys/car and create a new car
  • 45. David Renton Test • To do a test of functionality, do a: • View • Edit • Delete • Recreate a car Check http://localhost:8761/#/applications
  • 47. David Renton Milestone You have created a front end that can read and write data to your microservice all registered through your local Eureka server.
  • 48. David Renton A second Microservice Create a directory for the app and cd to it - RUN: cd .. && mkdir dealer-app && cd dealer-app
  • 49. David Renton Run the JHipster wizard Chose whichever options suit you best, the only caveat’s are: The port should be 8082 The production database needs to be PostgreSQL jhipster In the CMD window in the dealer-app directory - RUN
  • 50. David Renton Here are the options I chose:? Which *type* of application would you like to create? Microservice application ? What is the base name of your application? dealerapp ? As you are running in a microservicearchitecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8082 ? What is your default Java package name? com.dealer.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes) ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling ? Would you like to install other generators from the JHipster Marketplace? No
  • 51. David Renton Create an entity I gave the entity 2 fields: • name • address jhipster entity dealer In the same window and directory (car-app) RUN:
  • 52. David Renton Here are the options I chose: ? Do you want to add a field to your entity? Yes ? What is the name of your field? name ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? address ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? No ? Do you want to add a relationship to another entity? No ? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly ? Do you want pagination on your entity? Yes, with infinite scroll
  • 53. David Renton Run the app ./mvnw In the same window and directory (dealer-app) RUN:
  • 54. David Renton Add entity to the gateway jhipster entity dealer In the same window navigate to the gateway-app directory (cd ../gateway-app) RUN:
  • 55. David Renton Here are the options I chose: ? Do you want to generate this entity from an existing microservice? Yes ? Enter the path to the microservice root directory: ../dealer-app ? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity conflict webpackwebpack.dev.js
  • 56. David Renton Run the app Automatically generated credentials are admin/admin and user/user ./mvnw In the same window and directory (gateway-app) RUN:
  • 57. David Renton Check the microservice through the gateway • To see the updated project navigate to: http://localhost:8080/ Login with Admin/Admin Navigate to entitys/car and create a new car
  • 58. David Renton Test • To do a test of functionality, do a: • View • Edit • Delete • Recreate a dealer Check http://localhost:8761/#/applications
  • 60. David Renton Milestone • You have created a second microservice and attached it to an already running gateway.
  • 61. David Renton Test automation • Depending on the tests you included in your selections • Jhipster has built them for you and stored them in the test folder • run them!! ./mvnw clean test gulp test npm run e2e
  • 62. David Renton Code Quality Run the Sonar Docker container at the root of your project Login to Sonar with admin/admin at: Run a build and pipe the results to Sonar ./mvnw -Pprod clean test sonar:sonar http://127.0.0.1:9001/ docker-compose -f src/main/docker/sonar.yml up –d http://127.0.0.1:9001/
  • 63. David Renton Deploy You must create a Heroku account heroku.com
  • 64. David Renton What is Heroku • Heroku is a cloud platform that lets companies build, deliver, monitor and scale apps — we're the fastest way to go from idea to URL, bypassing all those infrastructure headaches. • Heroku, one of the first cloud platforms, has been in development since June 2007 • Heroku was acquired by Salesforce.com in 2010 for $212 million • Heroku gives us free credits, allowing us to test generated applications with complex, high-end setups, to guarantee everything works well for our common users
  • 65. David Renton Heroku JHipster registry https://dashboard.heroku.com/new?&template=https%3A%2F%2Fgithub.co m%2Fjhipster%2Fjhipster-registry Open a browser and navigate to: This is a special link that lets Heroku know you are using Jhipster microservices and will need a Jhipster registry the same as your local one.
  • 66. David Renton Here are the options I chose: I've used the name neueda and the region as Europe Then deploy app The registry address will be https://[appname].herokuapp.com so in my case the address will be https://neueda.herokuapp.com.
  • 67. David Renton Open the projects in an IDE Change the address of the registry in the: application-prod.yml bootstrap-prod.yml Src-main-resource-config
  • 68. David Renton Open the projects in an IDE The registry address will be https://[appname].herokuapp.com so in my case the address will be https://neueda.herokuapp.com. uri: http://admin:${jhipster.registry.password}@neueda.herokuapp.com/config hostname: https://admin:admin@neueda.herokuapp.com
  • 69. David Renton Heroku CLI heroku login Log in with the CLI by running the following command RUN: **$ heroku login** Enter your Heroku credentials. Email: YOUR_EMAIL Password (typing will be hidden): YOUR_PASSWORD Authentication successful.
  • 70. David Renton Deploy your app to Heroku Jhipster heroku Navigate to each folder, gateway-app, car-app and dealer-app and RUN: The Heroku sub-generator will prompt you for the URL of your registry, which will be in the form https://[appname].herokuapp.com In my case the address will be https://neueda.herokuapp.com. Always allow Heroku to pick a name for your deployment.
  • 71. David Renton Deploy your app to Heroku jhipster heroku ? Name to deploy as: gateway ? On which region do you want to deploy ? us ? Which type of deployment do you want ? Git (compile on Heroku) ? The Heroku app "gateway" already exists! Use it anyways? No, generate a random name https://damp-crag-59450.herokuapp.com/ | https://git.heroku.com/damp-crag- 59450.git ? What is the name of your JHipster Registry Heroku app? neueda ? What is your JHipster Registry username? admin ? What is your JHipster Registry password? admin JHIPSTER_REGISTRY_URL: https://admin:admin@neueda.herokuapp.com
  • 72. David Renton Check the cloud logs for progress
  • 73. David Renton Heroku tips If the worst happens: Delete the application-heroku-yml and bootstrap-heroku.yml Then in .yo.rc.json remove the “herokuAppName” Make sure the value for herokuDeployType is git
  • 74. David Renton Redeploy your app to Heroku Jhipster heroku After making modifications to the source
  • 76. David Renton CI/CD JHipster should support the following CI systems out of the box: Jenkins: Setting up Jenkins 1 Setting up Jenkins 2 (recommended) Travis: refer to the Travis Documentation GitLab CI: refer to the GitLab CI Documentation Azure Pipelines: refer to the Azure Pipelines Documentation Running the sub-generator To generate these config files, run this command in your project folder: jhipster ci-cd Then answer all the questions.
  • 77. David Renton What pipeline do you want? The CI/CD pipeline you want to generate: Jenkins pipeline Azure Pipelines GitLab CI Travis CI Note: when you select Jenkins pipeline, a new src/main/docker/jenkins.yml file will be generated. So you can test Jenkins locally by running: docker-compose -f src/main/docker/jenkins.yml up -d

Editor's Notes

  1. https://github.com/nytimes/gizmo http://twitter.github.io/finagle http://spring.io/projects/spring-boot
  2. https://www.vagrantup.com/downloads.html
  3. https://www.virtualbox.org/wiki/Downloads
  4. On Mac or Linux vagrant init jhipster/jhipster-devbox; vagrant up --provider virtualbox On Windows vagrant init jhipster/jhipster-devbox vagrant up --provider virtualbox Make sure hyper-V is turne https://github.com/jhipster/jhipster-devboxd off in windows settings.
  5. A gateway is a JHipster-generated application (using application type microservice gateway when you generate it) that handles Web traffic, and serves an Angular application. There can be several different gateways, if you want to follow the Backends for Frontends pattern, but that’s not mandatory. Traefik is a modern HTTP reverse proxy and load balancer that can work with a gateway. The JHipster Registry is a runtime application on which all applications registers and get their configuration from. It also provides runtime monitoring dashboards. Consul is a service discovery service, as well as a key/value store. It can be used as an alternative to the JHipster Registry. JHipster UAA is a JHipster-based User Authentication and Authorization system, which uses the OAuth2 protocol. Microservices are JHipster-generated applications (using application type microservice application when you generate them), that handle REST requests. They are stateless, and several instances of them can be launched in parallel to handle heavy loads. The JHipster Console is a monitoring & alerting console, based on the ELK stack. Service-based networking for dynamic infrastructure https://github.com/Netflix/eureka https://www.consul.io/ https://github.com/Netflix/zuul Zuul is an edge service that provides dynamic routing, monitoring, resiliency, security, and more. Please view the wiki for usage, information, HOWTO, etc https://github.com/Netflix/zuul/wiki https://spring.io/ https://www.docker.com/
  6. git clone https://github.com/jhipster/jhipster-registry When the gateways and the microservices are launched, they will register themselves in the registry
  7. cd jhipster-registry && ./mvnw The JHipster Registry has three main purposes: It is an Eureka server, that serves as a discovery server for applications. This is how JHipster handles routing, load balancing and scalability for all applications. It is a Spring Cloud Config server, that provide runtime configuration to all applications. It is an administration server, with dashboards to monitor and manage applications. MBNW is a Maven wrapper - mvn -N io.takari:maven:wrapper -Dmaven=3.6.0
  8. cd jhipster-registry && yarn && yarn start
  9. http://localhost:8761
  10. mkdir car-app && cd car-app
  11. jhipster If your application uses an SQL data. with a local cache, your service instances won’t have a synchronized cache, resulting in incorrect data without any cache, the burden of scaling will be pushed to the database, which won’t be very good at it (unless you use our Cassandra option) Using Hazelcast with microservices will result in a specific configuration: At start-up, your application will connect to the JHipster Registry to find if other instances of the same service are running With the dev profile, JHipster will create a cluster of those instances on localhost (127.0.0.1), using a different port per instance. By default, the Hazelcast port is your application's port + 5701 (so if your application’s port is 8081, Hazelcast will use port 13782) With the prod profile, JHipster will create a cluster with all the other nodes it finds, using the default Hazelcast port (5701) base, JHipster proposes a Hazelcast caching solution
  12. ? Which *type* of application would you like to create? Microservice application ? What is the base name of your application? carsapp ? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081 ? What is your default Java package name? com.car.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes) ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling ? Would you like to install other generators from the JHipster Marketplace? No
  13. jhipster entity car
  14. ? Do you want to add a field to your entity? Yes ? What is the name of your field? make ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? model ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? price ? What is the type of your field? BigDecimal ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? No ? Do you want to add a relationship to another entity? No ? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly ? Do you want pagination on your entity? Yes, with infinite scroll
  15. ./mvnw
  16. On the dashboard or http://localhost:8761/#/logs
  17. cd .. && mkdir gateway-app && cd gateway-app
  18. jhipster
  19. ? Which *type* of application would you like to create? Microservice gateway ? What is the base name of your application? gateway ? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8080 ? What is your default Java package name? com.gateway.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Which *Framework* would you like to use for the client? React ? Would you like to enable *SASS* stylesheet preprocessor? No ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling, Protractor ? Would you like to install other generators from the JHipster Marketplace? No
  20. jhipster entity car
  21. ? Do you want to generate this entity from an existing microservice? Yes ? Enter the path to the microservice root directory: ../car-app ? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity conflict webpack\webpack.dev.js
  22. ./mvnw
  23. http://localhost:8080/
  24. Check http://localhost:8761/#/applications
  25. cd .. && mkdir dealer-app && cd dealer-app
  26. jhipster
  27. ? Which *type* of application would you like to create? Microservice application ? What is the base name of your application? dealerapp ? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8082 ? What is your default Java package name? com.dealer.app ? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards) ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token) ? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL) ? Which *production* database would you like to use? PostgreSQL ? Which *development* database would you like to use? H2 with disk-based persistence ? Do you want to use the Spring cache abstraction? Yes, with the Hazelcast implementation (distributed cache, for multiple nodes) ? Do you want to use Hibernate 2nd level cache? Yes ? Would you like to use Maven or Gradle for building the backend? Maven ? Which other technologies would you like to use? ? Would you like to enable internationalization support? Yes ? Please choose the native language of the application English ? Please choose additional languages to install Portuguese (Brazilian) ? Besides JUnit and Jest, which testing frameworks would you like to use? Gatling ? Would you like to install other generators from the JHipster Marketplace? No
  28. jhipster entity dealer
  29. ? Do you want to add a field to your entity? Yes ? What is the name of your field? name ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? Yes ? What is the name of your field? address ? What is the type of your field? String ? Do you want to add validation rules to your field? Yes ? Which validation rules do you want to add? Required ? Do you want to add a field to your entity? No ? Do you want to add a relationship to another entity? No ? Do you want to use separate service class for your business logic? No, the REST controller should use the repository directly ? Do you want pagination on your entity? Yes, with infinite scroll
  30. ./mvnw
  31. jhipster entity dealer
  32. ? Do you want to generate this entity from an existing microservice? Yes ? Enter the path to the microservice root directory: ../dealer-app ? Do you want to update the entity? This will replace the existing files for this entity, all your custom code will be overwritten Yes, re generate the entity conflict webpack\webpack.dev.js
  33. ./mvnw
  34. http://localhost:8080/
  35. Check http://localhost:8761/#/applications
  36. ./mvnw clean test gulp test npm run e2e JHipster comes with an extensive set of tests, and each generated application has: Integration tests using the Spring Test Context framework. UI tests with Jest. Optionally, JHipster can also generate: Performance tests with Gatling. Behaviour-driven tests with Cucumber Angular/React integration tests with Protractor. Protractor UI integration tests are done with Protractor, and are located in the src/test/javascript/e2e folder. Those tests will launch a Web browser and use the application like a real user would do, so you need to have a real application running, with its database set-up. Those tests can be run using npm run e2e To run Gatling performance tests, you must first install Gatling.
  37. docker-compose -f src/main/docker/sonar.yml up –d http://127.0.0.1:9001/ ./mvnw -Pprod clean test sonar:sonar http://127.0.0.1:9001/ Add the owasp dependency-check plugin Security check: <build> ... <plugins> ... <plugin> <groupId>org.owasp</groupId> <artifactId>dependency-check-maven</artifactId> <version>3.3.1</version> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> .. </plugins> ... </build> Running ./mvnw verify will generate a dependency check report under the target directory.
  38. https://dashboard.heroku.com/new?&template=https%3A%2F%2Fgithub.com%2Fjhipster%2Fjhipster-registry
  39. uri: http://admin:${jhipster.registry.password}@neueda.herokuapp.com/config hostname: https://admin:admin@neueda.herokuapp.com
  40. heroku login **$ heroku login** Enter your Heroku credentials. Email: YOUR_EMAIL Password (typing will be hidden): YOUR_PASSWORD Authentication successful.
  41. Jhipster heroku
  42. jhipster heroku ? Name to deploy as: gateway ? On which region do you want to deploy ? us ? Which type of deployment do you want ? Git (compile on Heroku) ? The Heroku app "gateway" already exists! Use it anyways? No, generate a random name https://damp-crag-59450.herokuapp.com/ | https://git.heroku.com/damp-crag-59450.git ? What is the name of your JHipster Registry Heroku app? neueda ? What is your JHipster Registry username? admin ? What is your JHipster Registry password? admin JHIPSTER_REGISTRY_URL: https://admin:admin@neueda.herokuapp.com
  43. Jhipster heroku
  44. jhipster ci-cd
  45. docker-compose -f src/main/docker/jenkins.yml up -d