Spring Boot Application Startup Process
--------------------------------------
"pde-template-business-service"
Phase 1: JVM & Build Tool Kickoff
---------------------------------
1. IDE triggers Gradle → [Link] compiles sources (compileJava) with Java 21 toolchain
2. Annotation Processors run → Lombok (@Data, @Builder, etc.) generates boilerplate bytecode
3. JVM launches → [Link]() is the entry point
Phase 2: [Link]() starts
---------------------------------------
[Link]() executes:
[Link]([Link], args);
Internally:
1. Creates SpringApplication instance
2. Detects app type → Servlet (spring-boot-starter-web → Tomcat)
3. Loads [Link] → [Link]
Phase 3: [Link] loaded FIRST
------------------------------------------
CRITICAL: Runs BEFORE [Link]
[Link]=
[Link],
[Link],
[Link],
[Link]
Ensures custom config overrides defaults
Phase 4: [Link] loaded
-------------------------------
App name set: pde-template-business-service
Spring Cloud Config Server contacted:
[Link]=configserver:${[Link]:[Link]
Configuration loaded:
- Multipart settings (max 22MB)
- MVC path matching (ANT_PATH_MATCHER)
- Logging levels and patterns
- Feign timeout (900000ms)
- Eureka service URLs
- Redis (SSL enabled, max 100)
- MongoDB settings
- GraphQL paths (/internal/graphql, /internal/graphiql)
Phase 5: ApplicationContext & Bean Wiring
-----------------------------------------
@ComponentScan packages:
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link].*
[Link]
Beans initialized (rough order):
1. Configuration classes (Config, RedisConfig, DataSourceConfig, AsyncExecutorConfig, SwaggerConfig)
2. Repository beans (MongoDB repositories)
3. Service beans (@Service)
4. Components / Utils
5. Feign clients (@EnableFeignClients)
6. RestControllers
7. GraphQL wiring
8. @EnableRetry
9. Kafka stream bindings
Phase 6: Infrastructure Connections
-----------------------------------
- MongoDB connects (custom config)
- Redis connects (connection pool, SSL)
- AsyncExecutor thread pool (400–500 threads)
- Liquibase applies DB changes
- Kafka clients initialize (3.9.2)
Phase 7: Eureka Registration
----------------------------
Application registers with service registry
eureka:
client:
register-with-eureka: true
fetch-registry: true
enabled: true
service-url:
defaultZone: ${[Link]}/eureka/
Phase 8: Embedded Tomcat Starts
-------------------------------
1. Tomcat starts on port 8080
2. Servlet context initialized
3. Controllers and GraphQL routes mapped
4. SecurityFilterChain applied
5. Custom filters registered
Phase 9: Application Ready
--------------------------
1. Actuator endpoints exposed
2. Swagger UI available
3. ApplicationReadyEvent triggered
4. Console: Started TemplateBusinessApplication
Quick Reference Summary
-----------------------
JVM → [Link] → config server → [Link] → bean wiring → infra → eureka → to
Important Notes
---------------
- [Link] runs BEFORE [Link]
- Custom config overrides Spring Boot defaults
- @EnableRetry adds retry logic
- GraphQL paths: /internal/graphql, /internal/graphiql
- Feign timeout: 15 minutes
- Async thread pool: high concurrency (400–500 threads)