(Go: >> BACK << -|- >> HOME <<)

SlideShare a Scribd company logo
1
© 2016 Pivotal
Spring Boot & Actuators
John Humphreys, VP in Systems Mgmt. Engineering
Nomura Securities
Email: johnwilliamhumphreys@gmail.com
2
Agenda
Spring Boot Actuators – Spring Days – John Humphreys
§  Problems with Development
§  What is Spring Boot?
§  How do we use it?
§  Live coding – Build a spring boot app
§  Live coding – Add actuators for monitoring
§  Deployment as a service
§  Live coding - Hook up to the admin console
3
Problems With Development
In Java, and in general.
Spring Boot Actuators – Spring Days – John Humphreys
4
What problems are we trying to solve?
Spring Boot Actuators – Spring Days – John Humphreys
§  Developers keep re-solving the same problems.
•  The point of coding is to build your business value-added services; be they your
trading algorithms, your music service, etc.
•  Any time spent doing anything else is (usually) wasted.
§  Development with Java is mostly boiler-plate.
•  Web-applications are very common and require lots of configuration/setup.
•  Packaging, deployment, and monitoring take time (every time!). This is a waste
to your productivity; they are tangential to your business logic.
•  There are too many custom variations of essentially the same configuration,
project layout, and deployment (makes standardization/training hard).
5
What is Spring Boot?
An introduction to the framework
Spring Boot Actuators – Spring Days – John Humphreys
6
According to the project itself:
Spring Boot Actuators – Spring Days – John Humphreys
“
Spring Boot makes it easy to create
standalone, production-grade Spring
based applications that you can just run.
Spring.io
7 Spring Boot Actuators – Spring Days – John Humphreys
“
We take an opinionated view of the
platform and third-party libraries so that
you can get started with minimum fuss.
Spring.io
According to the project itself:
8
Key Features
Spring Boot Actuators – Spring Days – John Humphreys
§  Get Spring web-services running with just couple lines of code (literally).
§  Embed Tomcat or Undertow directly into them, providing a runnable JAR.
§  Automatically configure Spring wherever possible (you can actually run
without any configuration out of the box).
§  Make your WAR function as an init.d service.
§  Add standard metrics, health checks, and externalized configuration.
§  Integrate with a huge number of things out of the box; for example:
•  Consul for discoverability/distributed configuration.
•  Admin console for managing spring apps.
9
How Do We Use It?
A brief introduction.
Spring Boot Actuators – Spring Days – John Humphreys
10
Bare Application Code
Spring Boot Actuators – Spring Days – John Humphreys
You can actually start up a Spring Boot web-app with just this code (and a few
maven dependencies):
It will properly launch a web server and pick up any configuration files you
provide. But that’s all it does as we have no endpoints!
11
Adding an Endpoint
Spring Boot Actuators – Spring Days – John Humphreys
To make our service useful, we need to add a controller and endpoint.
Spring Boot will automatically component scan our classes (locate them and
wire them together) when it finds annotations like @Controller.
12
Maven Dependencies
Spring Boot Actuators – Spring Days – John Humphreys
To make the code we just saw work, we need just 2 things from maven.
1.  Derive from Spring Boot starter parent POM.
2.  Include the spring-boot starter web dependency.
13
Configuration File
Spring Boot Actuators – Spring Days – John Humphreys
Since we are trying to read a ${custom.message} property, we also need a
configuration file.
But by default we don’t need one, it would just run on port 8080 out of the
box; this is just specific to our code.
§  Add a “resources” folder under src/main
§  Add an application.properties file to it.
§  Add custom.message=Hello Spring Days!!!
§  You can also override the server defaults here:
•  server.port=[number]
•  server.contextpath=[/path]
14
What Does @SpringBootApplication Do?
Spring Boot Actuators – Spring Days – John Humphreys
It is syntactic sugar for multiple other powerful annotations commonly used
together in Spring. From the docs:
“Many Spring Boot developers always have their
classes annotated with @Configuration,
@EnableAutoConfiguration, and
@ComponentScan…Spring Boot provides a
convenient @SpringBootApplication alternative.
Spring.io
15 Spring Boot Actuators – Spring Days – John Humphreys
§  @Configuration is used to turn a class into a JavaConfig source so you can
define beans in it, etc. The class used in SpringApplication.run() should be
a configuration class (though XML configs are possible).
§  @EnableAutoConfiguration attempts to guess and configure beans that you
are likely to need based on our code and class-path. E.g. if Tomcat is
present due to web dependencies in the POM, it will set it up and use it for
you.
§  @ComponentScan is used to tell Spring to automatically search for and
wire up classes based on their annotations (e.g. make @Controllers register
themselves, populate @Value variables, etc.)
What do @SpringBootApplication’s sub-annotations do?
16
Live Coding Session Part #1
Let’s make the application!
Spring Boot Actuators – Spring Days – John Humphreys
17 Spring Boot Actuators – Spring Days – John Humphreys
Before we code this, just know that Spring Initializr can do it for you! I’m just
doing it to show you how easy it is J.
Spring Boot InitializR
18 Spring Boot Actuators – Spring Days – John Humphreys
§  The code is hosted on GitHub; feel free to explore it.
•  https://github.com/w00te/spring-days-spring-boot-example
§  Also, to keep things co-located, here’s the admin console code for later on.
•  https://github.com/w00te/spring-days-spring-boot-admin-console
§  What we’ll achieve
•  Create a new Java 1.8 Maven application using the quick-start archetype.
•  Add in our maven dependencies.
•  Add in our main class and controller.
•  Add a properties file.
•  Test our application on our own custom-defined port/context.
Live Coding Session Part #1
19
Live Coding Session Part #2
Let’s add monitoring and deployment features!
Spring Boot Actuators – Spring Days – John Humphreys
20 Spring Boot Actuators – Spring Days – John Humphreys
§  Spring boot actuator provides production grade metrics, auditing, and
monitoring features to your application.
§  Just adding the actuator dependency makes it available on our 8080 port. If
we add hateoas as well, it will make it restfully navigable under /actuator.
No code is required J.
§  We’ll also disable actuator endpoint security to make this demo run
smoother of course J. We can do this by adding these two properties:
Adding Actuator
21 Spring Boot Actuators – Spring Days – John Humphreys
§  Live thread dumps
§  Live stack traces
§  Logger configurations
§  Password-masked properties file auditing
§  Heap dump trigger (can be disabled)
§  Web-request traces
§  Application metrics
§  Spring bean analysis
§  More! (and it’s extensible)
Actuator Features to Notice
22
Application Deployment
Deploying as an init.d service on Linux
Spring Boot Actuators – Spring Days – John Humphreys
23 Spring Boot Actuators – Spring Days – John Humphreys
§  Spring Boot builds an uber-JAR by default. So, the JAR it builds has all
dependencies required for your application to run.
§  It does this with the spring-boot-maven-plugin.
§  If you ask it to make the JAR executable as well, it will be runnable and will
support Linux init.d services (management with “service <name> start/stop/
restart/status, auto-start with OS, etc.).
Deploying as an Init.d Service (Part I)
24 Spring Boot Actuators – Spring Days – John Humphreys
§  Once you’ve made a JAR executable, you can view it in a text editor and you
will notice that there is literally a bash script at the top of your JAR above
the binary section; it’s pretty interesting to see.
§  External configuration:
•  Put a <jar-name>.conf file next to the JAR (or a sym-link to one).
•  Define your environment variables in it (e.g. JVM size, logging and property file
locations, etc).
•  It will automatically be picked up at run time.
Deploying as an Init.d Service (Part II)
25
Live Coding Session Part #3
Integrating with the Admin Console
Spring Boot Actuators – Spring Days – John Humphreys
26 Spring Boot Actuators – Spring Days – John Humphreys
§  Monitors your spring-boot applications and lets you interact with them.
§  Is a spring-boot application itself; include parent POM and a couple
dependencies, set ports in the same way. Run as a separate application.
http://codecentric.github.io/spring-boot-admin/1.5.0/#getting-started
§  Add a client-dependency to the apps you want to monitor (like the one we
just built) and set a property, and it works great! J
Admin Console Server
27 Spring Boot Actuators – Spring Days – John Humphreys
Admin Console Server Features
§  Dynamically change logging levels (e.g. add trace logging to debug a
request temporarily and know how to fix it in dev).
§  Perform JMX calls.
§  View your application metrics.
§  View web request and response pairs for your web-app (including headers).
§  View the environment, stack traces, etc.
§  Basically anything actuator exposes is beautifully represented here.
§  Applications are automatically detected and you get a log of when they start
up, shut down, etc.
28 Spring Boot Actuators – Spring Days – John Humphreys
29
The End
Any questions or comments?
Spring Boot Actuators – Spring Days – John Humphreys

More Related Content

What's hot

Spring boot
Spring bootSpring boot
Spring boot
Gyanendra Yadav
 
Spring Boot
Spring BootSpring Boot
Spring Boot
HongSeong Jeon
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué Neis
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
Toshiaki Maki
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
tola99
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
Jakub Kubrynski
 
Spring boot
Spring bootSpring boot
Spring boot
Pradeep Shanmugam
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
Swagger UI
Swagger UISwagger UI
Swagger UI
Walaa Hamdy Assy
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
Dzmitry Naskou
 
Spring framework aop
Spring framework aopSpring framework aop
Spring framework aop
Taemon Piya-Lumyong
 
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
sourabh aggarwal
 
Swagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdfSwagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdf
Knoldus Inc.
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
Dzmitry Naskou
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Harshit Choudhary
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 

What's hot (20)

Spring boot
Spring bootSpring boot
Spring boot
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
Spring boot
Spring bootSpring boot
Spring boot
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Swagger UI
Swagger UISwagger UI
Swagger UI
 
Spring Framework - Spring Security
Spring Framework - Spring SecuritySpring Framework - Spring Security
Spring Framework - Spring Security
 
Spring framework aop
Spring framework aopSpring framework aop
Spring framework aop
 
Spring boot
Spring bootSpring boot
Spring boot
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
 
Swagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdfSwagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdf
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 

Similar to Spring Boot & Actuators

Spring Boot
Spring BootSpring Boot
Spring Boot
Jaran Flaath
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
Nilanjan Roy
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
🎤 Hanno Embregts 🎸
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
Mbakaya Kwatukha
 
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptxdokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
Appster1
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
🎤 Hanno Embregts 🎸
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
Mark Myers
 
Module 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to beginModule 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to begin
Deepakprasad838637
 
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSEcadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
CHARANKUMARREDDYBOJJ
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
michaelaaron25322
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
hassan hafez
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind Tour
VMware Tanzu
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
Slobodan Lohja
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
Alex Movila
 
Web application penetration testing lab setup guide
Web application penetration testing lab setup guideWeb application penetration testing lab setup guide
Web application penetration testing lab setup guide
Sudhanshu Chauhan
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
Lars Vogel
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Amazon Web Services
 

Similar to Spring Boot & Actuators (20)

Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
 
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
Building a Spring Boot Application - Ask the Audience! (from JVMCon 2018)
 
Django simplified : by weever mbakaya
Django simplified : by weever mbakayaDjango simplified : by weever mbakaya
Django simplified : by weever mbakaya
 
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptxdokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx
 
Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!Building a Spring Boot Application - Ask the Audience!
Building a Spring Boot Application - Ask the Audience!
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Module 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to beginModule 6 _ Spring Boot for java application to begin
Module 6 _ Spring Boot for java application to begin
 
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSEcadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
cadec-2029-SPRING SPRING BOOT LEARNIGN PURPOSE
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind Tour
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Web application penetration testing lab setup guide
Web application penetration testing lab setup guideWeb application penetration testing lab setup guide
Web application penetration testing lab setup guide
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 

More from VMware Tanzu

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
VMware Tanzu
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
VMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
VMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
VMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
VMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
VMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
VMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
VMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
VMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
VMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
VMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
VMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
VMware Tanzu
 

More from VMware Tanzu (20)

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 

Recently uploaded

Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Estuary Flow
 
Disk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFSDisk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFS
Ortus Solutions, Corp
 
How to Break Your App with Playwright Tests
How to Break Your App with Playwright TestsHow to Break Your App with Playwright Tests
How to Break Your App with Playwright Tests
Ortus Solutions, Corp
 
Design system: The basis for a consistent design
Design system: The basis for a consistent designDesign system: The basis for a consistent design
Design system: The basis for a consistent design
Ortus Solutions, Corp
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
Ortus Solutions, Corp
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
AUGNYC
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02
williamrobertherman
 
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
Misti Soneji
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
Ortus Solutions, Corp
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
Ortus Solutions, Corp
 
AI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdfAI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdf
ayushiqss
 
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas... @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
AlinaDevecerski
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Asher Sterkin
 
Panvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
Panvel @Call @Girls Whatsapp 9833363713 With High Profile OfferPanvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
Panvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
$A19
 
Revolutionizing Task Scheduling in ColdBox
Revolutionizing Task Scheduling in ColdBoxRevolutionizing Task Scheduling in ColdBox
Revolutionizing Task Scheduling in ColdBox
Ortus Solutions, Corp
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
Ortus Solutions, Corp
 

Recently uploaded (20)

Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple StepsSeamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
Seamless PostgreSQL to Snowflake Data Transfer in 8 Simple Steps
 
Disk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFSDisk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFS
 
How to Break Your App with Playwright Tests
How to Break Your App with Playwright TestsHow to Break Your App with Playwright Tests
How to Break Your App with Playwright Tests
 
Design system: The basis for a consistent design
Design system: The basis for a consistent designDesign system: The basis for a consistent design
Design system: The basis for a consistent design
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
NYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdfNYC 26-Jun-2024 Combined Presentations.pdf
NYC 26-Jun-2024 Combined Presentations.pdf
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02Java SE 17 Study Guide for Certification - Chapter 02
Java SE 17 Study Guide for Certification - Chapter 02
 
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe@ℂall @Girls Kolkata  ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
@ℂall @Girls Kolkata ꧁❤ 000000000 ❤꧂@ℂall @Girls Service Vip Top Model Safe
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
Migrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS CloudMigrate your Infrastructure to the AWS Cloud
Migrate your Infrastructure to the AWS Cloud
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
 
AI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdfAI Chatbot Development – A Comprehensive Guide  .pdf
AI Chatbot Development – A Comprehensive Guide  .pdf
 
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas... @Call @Girls in Saharanpur 🐱‍🐉  XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
@Call @Girls in Saharanpur 🐱‍🐉 XXXXXXXXXX 🐱‍🐉 Tanisha Sharma Best High Clas...
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
 
Panvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
Panvel @Call @Girls Whatsapp 9833363713 With High Profile OfferPanvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
Panvel @Call @Girls Whatsapp 9833363713 With High Profile Offer
 
Revolutionizing Task Scheduling in ColdBox
Revolutionizing Task Scheduling in ColdBoxRevolutionizing Task Scheduling in ColdBox
Revolutionizing Task Scheduling in ColdBox
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
 

Spring Boot & Actuators

  • 1. 1 © 2016 Pivotal Spring Boot & Actuators John Humphreys, VP in Systems Mgmt. Engineering Nomura Securities Email: johnwilliamhumphreys@gmail.com
  • 2. 2 Agenda Spring Boot Actuators – Spring Days – John Humphreys §  Problems with Development §  What is Spring Boot? §  How do we use it? §  Live coding – Build a spring boot app §  Live coding – Add actuators for monitoring §  Deployment as a service §  Live coding - Hook up to the admin console
  • 3. 3 Problems With Development In Java, and in general. Spring Boot Actuators – Spring Days – John Humphreys
  • 4. 4 What problems are we trying to solve? Spring Boot Actuators – Spring Days – John Humphreys §  Developers keep re-solving the same problems. •  The point of coding is to build your business value-added services; be they your trading algorithms, your music service, etc. •  Any time spent doing anything else is (usually) wasted. §  Development with Java is mostly boiler-plate. •  Web-applications are very common and require lots of configuration/setup. •  Packaging, deployment, and monitoring take time (every time!). This is a waste to your productivity; they are tangential to your business logic. •  There are too many custom variations of essentially the same configuration, project layout, and deployment (makes standardization/training hard).
  • 5. 5 What is Spring Boot? An introduction to the framework Spring Boot Actuators – Spring Days – John Humphreys
  • 6. 6 According to the project itself: Spring Boot Actuators – Spring Days – John Humphreys “ Spring Boot makes it easy to create standalone, production-grade Spring based applications that you can just run. Spring.io
  • 7. 7 Spring Boot Actuators – Spring Days – John Humphreys “ We take an opinionated view of the platform and third-party libraries so that you can get started with minimum fuss. Spring.io According to the project itself:
  • 8. 8 Key Features Spring Boot Actuators – Spring Days – John Humphreys §  Get Spring web-services running with just couple lines of code (literally). §  Embed Tomcat or Undertow directly into them, providing a runnable JAR. §  Automatically configure Spring wherever possible (you can actually run without any configuration out of the box). §  Make your WAR function as an init.d service. §  Add standard metrics, health checks, and externalized configuration. §  Integrate with a huge number of things out of the box; for example: •  Consul for discoverability/distributed configuration. •  Admin console for managing spring apps.
  • 9. 9 How Do We Use It? A brief introduction. Spring Boot Actuators – Spring Days – John Humphreys
  • 10. 10 Bare Application Code Spring Boot Actuators – Spring Days – John Humphreys You can actually start up a Spring Boot web-app with just this code (and a few maven dependencies): It will properly launch a web server and pick up any configuration files you provide. But that’s all it does as we have no endpoints!
  • 11. 11 Adding an Endpoint Spring Boot Actuators – Spring Days – John Humphreys To make our service useful, we need to add a controller and endpoint. Spring Boot will automatically component scan our classes (locate them and wire them together) when it finds annotations like @Controller.
  • 12. 12 Maven Dependencies Spring Boot Actuators – Spring Days – John Humphreys To make the code we just saw work, we need just 2 things from maven. 1.  Derive from Spring Boot starter parent POM. 2.  Include the spring-boot starter web dependency.
  • 13. 13 Configuration File Spring Boot Actuators – Spring Days – John Humphreys Since we are trying to read a ${custom.message} property, we also need a configuration file. But by default we don’t need one, it would just run on port 8080 out of the box; this is just specific to our code. §  Add a “resources” folder under src/main §  Add an application.properties file to it. §  Add custom.message=Hello Spring Days!!! §  You can also override the server defaults here: •  server.port=[number] •  server.contextpath=[/path]
  • 14. 14 What Does @SpringBootApplication Do? Spring Boot Actuators – Spring Days – John Humphreys It is syntactic sugar for multiple other powerful annotations commonly used together in Spring. From the docs: “Many Spring Boot developers always have their classes annotated with @Configuration, @EnableAutoConfiguration, and @ComponentScan…Spring Boot provides a convenient @SpringBootApplication alternative. Spring.io
  • 15. 15 Spring Boot Actuators – Spring Days – John Humphreys §  @Configuration is used to turn a class into a JavaConfig source so you can define beans in it, etc. The class used in SpringApplication.run() should be a configuration class (though XML configs are possible). §  @EnableAutoConfiguration attempts to guess and configure beans that you are likely to need based on our code and class-path. E.g. if Tomcat is present due to web dependencies in the POM, it will set it up and use it for you. §  @ComponentScan is used to tell Spring to automatically search for and wire up classes based on their annotations (e.g. make @Controllers register themselves, populate @Value variables, etc.) What do @SpringBootApplication’s sub-annotations do?
  • 16. 16 Live Coding Session Part #1 Let’s make the application! Spring Boot Actuators – Spring Days – John Humphreys
  • 17. 17 Spring Boot Actuators – Spring Days – John Humphreys Before we code this, just know that Spring Initializr can do it for you! I’m just doing it to show you how easy it is J. Spring Boot InitializR
  • 18. 18 Spring Boot Actuators – Spring Days – John Humphreys §  The code is hosted on GitHub; feel free to explore it. •  https://github.com/w00te/spring-days-spring-boot-example §  Also, to keep things co-located, here’s the admin console code for later on. •  https://github.com/w00te/spring-days-spring-boot-admin-console §  What we’ll achieve •  Create a new Java 1.8 Maven application using the quick-start archetype. •  Add in our maven dependencies. •  Add in our main class and controller. •  Add a properties file. •  Test our application on our own custom-defined port/context. Live Coding Session Part #1
  • 19. 19 Live Coding Session Part #2 Let’s add monitoring and deployment features! Spring Boot Actuators – Spring Days – John Humphreys
  • 20. 20 Spring Boot Actuators – Spring Days – John Humphreys §  Spring boot actuator provides production grade metrics, auditing, and monitoring features to your application. §  Just adding the actuator dependency makes it available on our 8080 port. If we add hateoas as well, it will make it restfully navigable under /actuator. No code is required J. §  We’ll also disable actuator endpoint security to make this demo run smoother of course J. We can do this by adding these two properties: Adding Actuator
  • 21. 21 Spring Boot Actuators – Spring Days – John Humphreys §  Live thread dumps §  Live stack traces §  Logger configurations §  Password-masked properties file auditing §  Heap dump trigger (can be disabled) §  Web-request traces §  Application metrics §  Spring bean analysis §  More! (and it’s extensible) Actuator Features to Notice
  • 22. 22 Application Deployment Deploying as an init.d service on Linux Spring Boot Actuators – Spring Days – John Humphreys
  • 23. 23 Spring Boot Actuators – Spring Days – John Humphreys §  Spring Boot builds an uber-JAR by default. So, the JAR it builds has all dependencies required for your application to run. §  It does this with the spring-boot-maven-plugin. §  If you ask it to make the JAR executable as well, it will be runnable and will support Linux init.d services (management with “service <name> start/stop/ restart/status, auto-start with OS, etc.). Deploying as an Init.d Service (Part I)
  • 24. 24 Spring Boot Actuators – Spring Days – John Humphreys §  Once you’ve made a JAR executable, you can view it in a text editor and you will notice that there is literally a bash script at the top of your JAR above the binary section; it’s pretty interesting to see. §  External configuration: •  Put a <jar-name>.conf file next to the JAR (or a sym-link to one). •  Define your environment variables in it (e.g. JVM size, logging and property file locations, etc). •  It will automatically be picked up at run time. Deploying as an Init.d Service (Part II)
  • 25. 25 Live Coding Session Part #3 Integrating with the Admin Console Spring Boot Actuators – Spring Days – John Humphreys
  • 26. 26 Spring Boot Actuators – Spring Days – John Humphreys §  Monitors your spring-boot applications and lets you interact with them. §  Is a spring-boot application itself; include parent POM and a couple dependencies, set ports in the same way. Run as a separate application. http://codecentric.github.io/spring-boot-admin/1.5.0/#getting-started §  Add a client-dependency to the apps you want to monitor (like the one we just built) and set a property, and it works great! J Admin Console Server
  • 27. 27 Spring Boot Actuators – Spring Days – John Humphreys Admin Console Server Features §  Dynamically change logging levels (e.g. add trace logging to debug a request temporarily and know how to fix it in dev). §  Perform JMX calls. §  View your application metrics. §  View web request and response pairs for your web-app (including headers). §  View the environment, stack traces, etc. §  Basically anything actuator exposes is beautifully represented here. §  Applications are automatically detected and you get a log of when they start up, shut down, etc.
  • 28. 28 Spring Boot Actuators – Spring Days – John Humphreys
  • 29. 29 The End Any questions or comments? Spring Boot Actuators – Spring Days – John Humphreys