SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Edureka!
 
Spring Boot Actuator
Spring Boot ActuatorSpring Boot Actuator
Spring Boot ActuatorRowell Belen
 
Spring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaSpring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaEdureka!
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosuĂŠ Neis
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring BootVincent Kok
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!Jakub Kubrynski
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring BootTrey Howard
 
Maven Overview
Maven OverviewMaven Overview
Maven OverviewFastConnect
 

Was ist angesagt? (20)

Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
 
Spring Boot Actuator
Spring Boot ActuatorSpring Boot Actuator
Spring Boot Actuator
 
Spring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaSpring Boot Interview Questions | Edureka
Spring Boot Interview Questions | Edureka
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Apache tomcat
Apache tomcatApache tomcat
Apache tomcat
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Tomcat
TomcatTomcat
Tomcat
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring Boot
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Introduction to Spring Boot!
Introduction to Spring Boot!Introduction to Spring Boot!
Introduction to Spring Boot!
 
Spring Core
Spring CoreSpring Core
Spring Core
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Maven
MavenMaven
Maven
 

Ähnlich wie Spring Boot & Actuators

Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservicesNilanjan 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 mbakayaMbakaya 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.pptxAppster1
 
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 🎸
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 serversMark 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 beginDeepakprasad838637
 
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 applicationsmichaelaaron25322
 
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 yeomanhassan hafez
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring applicationJimmy Lu
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind TourVMware Tanzu
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
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 guideSudhanshu Chauhan
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars 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 VariaAmazon Web Services
 
Spring Boot
Spring BootSpring Boot
Spring Bootkoppenolski
 
Automation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploitsAutomation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploitsMunir Njiru
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymerMarcus Hellberg
 

Ähnlich wie Spring Boot & Actuators (20)

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!
 
Xke spring boot
Xke spring bootXke spring boot
Xke 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
 
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
 
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
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Automation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploitsAutomation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploits
 
Booting up with polymer
Booting up with polymerBooting up with polymer
Booting up with polymer
 

Mehr von 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 ItVMware 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 2023VMware 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 ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware 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 ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware 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.pdfVMware 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 2023VMware 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 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware 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 2023VMware 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 BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware 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 PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

Mehr von VMware Tanzu (20)

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
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

KĂźrzlich hochgeladen

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto GonzĂĄlez Trastoy
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

KĂźrzlich hochgeladen (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

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