0% found this document useful (0 votes)
4 views7 pages

Running 3419

The document outlines prerequisites and key concepts for working with Spring Boot and Spring MVC, emphasizing their roles in microservice development and application monitoring. It discusses the advantages of using Spring Boot, such as reduced configuration time and built-in tools for development and deployment, while also addressing Maven's capabilities and limitations. Additionally, it covers application design, configuration, and the use of Spring Boot's autoconfiguration features, including the administration module for microservices.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Running 3419

The document outlines prerequisites and key concepts for working with Spring Boot and Spring MVC, emphasizing their roles in microservice development and application monitoring. It discusses the advantages of using Spring Boot, such as reduced configuration time and built-in tools for development and deployment, while also addressing Maven's capabilities and limitations. Additionally, it covers application design, configuration, and the use of Spring Boot's autoconfiguration features, including the administration module for microservices.

Uploaded by

Suresh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Prereq:

======
Spring Core and MVC
SQl and rest knowledge

Spring STS and java1.8


any database and Postman

Maven knowledge

https://github.com/srinivaskolaparthi/SpringBootSriniUpdated
https://github.com/kolaparthisrini/MicroservicesSrini

\\ndafile\Softwares\JEE\ELTP====Softwares
https://github.com/srinivaskolaparthi/Certifications

Spring MVC==30 mins


Spring boot=10mins

Spring:components,service....etc
n no of annotations.

In how many ways can we write config?


xml,annotation,javaconfig(@Configuration)
@Controller

Spring is more about beans.


How many beans are created on the backend?

JMX:is manily used for monitoring jVM based applications.


mainly java apps.

JvisualVM.
https://docs.spring.io/spring-boot/docs/current/api/

Boot= Spring+Automation

SPring MVC =42 jars


Spring Boot ===1 jar spring boot web

Why Spring Boot?

1)Boot is mainly used for Microservice Development.


2)Reduces the development and config time
3)Inbuilt containers/servers(embedded servers)
4)App monitoring services(health status checks/app status whther the app or
UP/down)
5)Boot provides you bunch of devlopment tools.(live reload server/autoreload/global
reloads...etc)
6)Better integration with devops culture.
7)Profiling is made easy in the case of spring boot.
8)Composite webservices and composite project artifacts are made easy in the case
of boot.
9)Auto configurations

DEVOPS is more about tools.

core java app interact with All devops tools---NO


Web app--50%-50%
i want a technology/module/project thru wich i can interact with all microservices
tools
and devops tools.

spring boot---solu

big data: apache kafka(streaming server/jms server)

JMX is mainly used for app monitorings.

Architecture released by Uber cabs..


Monolithic Microservice
Centralized Distributed
Cost is less Cost is more
Migration is difficult Migration is easy when compared with monolithic
Tightly coupleds Loosly coupled
Atoption to chANGES is difiicult Is Easy
learning curve is v less It is more

----------------------------------

ANT--->MAVEN( maven1/maven2/maven 3)--->Gradle

Maven:
==========
why maven?
1)Build tool
2)Dependency management
3)packaging
4)Profiling the app
5)Scaffolding
6)deployments
7)plugin support
8)Repository maintainance(using maven
we can create corporate repositories)
9)multi module project support.

Disadvantage:?
==============
xml based
Transtive dependecny management issues---****

Transtive dependecny?

child is dependent on parent.

Sol)Uber Jar or flat jar

jar with in jar.

Spring boot uses Uber jar concept to achive the goal.


nesting of the jars is 'n'th level

------------------------------------

How to design spring boot app?

to design boot a[pp,below are the ways


1)Spring STS/ECLIPSE
2)Spring boot cli--- is mainly used for dos machines.
3)Spring Boot starter io(thru browser)
4)MAVEN/gradle artifacts

pivotal server is a type app server from SpringPeople.


mainly used for PCF.

Src/main/java---for java classes


src/main/resources----for statis cna d dynamic web pages
plus boot configuration file

Boot: 1 config file.


application.properties.It can be in 2 formats.
1properties 2.yml format

Starter mean it is a dependency.

target---- after building your project the final jar is placed


into this location.

SpringBoot Stratertest is feature thru which we can do


spring boot unit testing.

By default boot runs on 8080.

8089,1521

By default spring boot supports opensource servers as embedded server.

Tomcat,jetty

Webspher/weblogic---commercial
no straight forward approach.thru workarounds.

@SpringBootApplication:
------------------------
@configuration===>java based config
@componentscan===>scan your entire code base with the specified packagename for
beans.
@enableautoconfiguration===>registers/identifys the beans based on the beans
configured in classpath
or pom.

SpringBootMVC:

POM.xml--->bootwebstarter
boottomcatstarter
?

Interceptor/Filter
Filterchain,chain of responsibilty remains
1)USing Springboot filters
2)Add servletSpec filters.

SpringMVC app:
web.xml---dispatcher servelet and listener
and loadonstartup.

what if some body is doing all these.


without manual coding.

Springboot autoconfigurator can perform all this tasks based on starter.

Autoconfigurator and starters are tightly coupled.

SpringApplication.run():?
-----------
1)BootStrapping--Load all necessary components.
2)Application Context is created
public ConfigurableApplicationContext run(String... args) {
// Create, load, refresh, and run the ApplicationContext
context = createApplicationContext();
return context ; // handle to the context object for the developer
}
3)The createApplicationContext method checks if it is a web or standalone
application based on the type it creates for the context.
IF the app is web then AnnotationConfigEmbeddedWebApplicationContext will be
initialized.
else AnnotationConfigApplicationContext will be initialized.
4)Once initialized, All your @Repository, @Component, @Service, and @Controller
beans will be
registered and the context is returned.

We created a simple bootmvc app.

We are able to create a rest service successfully.


Springboot Administration module:

Springboot Admin module is mainly for microservices.


Admin module:2 components
1)admin component(admin-starter thru wich we can do admin tasks on the services
2)client component(admin-starter-client)

Whitelabel:
-----------
whenever we run any web application,by default server expects a welcome file named
as
index.html.

r we having any error handler? no


fallback? no
whitelable error means it can be resourcenot found(server error)

Resolve:
disable whitelable in ur project
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

Excluding Resources from auto-reload


By default, Auto-reload works on these paths:

/META-INF/maven
/META-INF/resources
/resources
/static
/public
/templates
If you want to disable auto-reload in browser for files in few of these paths, then
use spring.devtools.restart.exclude property. e.g.

spring.devtools.restart.exclude=static/**,public/**

Watching/Excluding Additional Paths


There may be few files not in classpath, but you still may want to watch those
addtional files/paths to reload the application. To do so, use the
spring.devtools.restart.additional-paths property.

spring.devtools.restart.additional-paths=script/**
Similarily, If you want to keep those defaults and add additional exclusions, use
the spring.devtools.restart.additional-exclude property instead.

spring.devtools.restart.additional-exclude=styles/**

You might also like