- Hands-On Microservices with Kotlin
- Juan Antonio Medina Iglesias
- 181字
- 2021-06-30 19:10:56
Creating an application object
The @SpringBootApplication annotation provides a convenient way to bootstrap a Spring application that can be started from a main() method. In many situations, you can just delegate to the static runApplication method:
@SpringBootApplication
class Chapter2Application
fun main(args: Array<String>) {
runApplication<Chapter2Application>(*args)
}
You can see that we have used the @SpringBootApplication annotation for marking a class that we will use as our application context. We will learn more about the Spring Application Context shortly.
When a Spring Boot application starts it will autoconfigure all the required systems; if it is a web app, it will start a web application.
Spring Boot provides an embedded Tomcat server that will start when our application starts. This is a fully functional server, so it's not required to deploy our software in any application server. However, Spring allows us to do it. We will discuss more on this in the section: Packing and running a Spring Boot application.
The application will also configure and run any other system that we need, such as a connection pool to a database or a queue.
推薦閱讀
- JavaScript:Functional Programming for JavaScript Developers
- 算法精粹:經(jīng)典計算機科學問題的Java實現(xiàn)
- C#程序設計(慕課版)
- Learning Python Design Patterns(Second Edition)
- 飛槳PaddlePaddle深度學習實戰(zhàn)
- Visual Basic程序設計教程
- Spring Boot+Vue全棧開發(fā)實戰(zhàn)
- QGIS Python Programming Cookbook(Second Edition)
- Programming Microsoft Dynamics? NAV 2015
- 網(wǎng)絡數(shù)據(jù)采集技術:Java網(wǎng)絡爬蟲實戰(zhàn)
- 深入實踐DDD:以DSL驅(qū)動復雜軟件開發(fā)
- 3ds Max 2018從入門到精通
- Spring Microservices
- Learning Rust
- Nginx Troubleshooting