Spring Boot的这些基操你都会了嘛?

Spring Boot系列十三 Spring Boot集成RabbitMQ 1. 概述之前我有一系列关于RabbitMQ文章介绍了RabbitMQ的用法,本篇我们介绍如何在Spring Boot中集成RabbitMQ。本篇主要内容如下: 在Spring boot中消息的发送和接收的两种方式的demo 配置使用MessageConverter对消息序列化 2. Demo工程公共部分介绍工程名称:rabbitmq需要在我们的工程中的pom.xml引入新jar <!-- spri 阅读详情

1 Pom文件

1.1 spring-boot-starter-parent

表示当前pom文件从
spring-boot-starter-parent继承下来,在
spring-boot-starter-parent中提供了很多默认配置,可以简化我们的开发。

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

  • Java版本和编码方式
<properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <resource.delimiter>@</resource.delimiter>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

  • 依赖管理spring-boot-dependencies
<properties>
    <activemq.version>5.15.9</activemq.version>
    <antlr2.version>2.7.7</antlr2.version>
    <appengine-sdk.version>1.9.73</appengine-sdk.version>
    <artemis.version>2.6.4</artemis.version>
    ...
</properties>

这样比如使用starter-web的时候就不需要指定版本号

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <version>2.1.4.RELEASE</version>
</dependency>

  • 使用自己的parent项目

这时候将依赖管理的问题放到dependencyManagement中。

官网说明文档见:13.2.2 Using Spring Boot without the Parent POM

<dependencyManagement>
   <dependencies>
      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-dependencies</artifactId>
         <version>2.1.4.RELEASE</version>
         <type>pom</type>
         <scope>import</scope>
      </dependency>
   </dependencies>
</dependencyManagement>

1.2 打包管理

使用mvn package打包的plugin。

<build>
   <plugins>
      <plugin>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
   </plugins>
</build>

1.3 Starters

官网见:13.5 Starters

Starters are a set of convenient dependency descriptors that you can include in your application. You get a one-stop shop for all the Spring and related technologies that you need without having to hunt through sample code and copy-paste loads of dependency descriptors. For example, if you want to get started using Spring and JPA for database access, include the spring-boot-starter-data-jpa dependency in your project.

  • 官方starter命名

spring-boot-starter-*

  • 自定义starter命名

thirdpartyproject-spring-boot-starter

  • spring-boot-web-starter

查看其diagram,可以排除某个依赖

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
   <exclusions>
      <exclusion>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-tomcat</artifactId>
      </exclusion>
   </exclusions>
</dependency>

2 XXXApplication

2.1 @SpringBootApplication

官网见:18. Using the @SpringBootApplication Annotation

等同于@EnableAutoConfiguration,@ComponentScan和@Configuration

2.2 SpringApplication.run

官网见:23. SpringApplication

3 配置文件

3.1 初步感受

server.port=9090

3.2 yml文件

application.yml

3.3 给属性注入值

  • 实体类Person和IDCard
public class Person {
    private String name;
    private int age;
    private Date birthday;
    private String[] hobbies;
    private IDCard idCard;
    ...
}
public class IDCard {
    private int id;
    private String number;
}
  • yml注入写法
person:
    name: Jack
    age: 17
    birthday: 1997/06/01
    hobbies: [code,sing,share]
    idCard: 
        id: 1
        number: 111
  • Person类增加注解
@Component
@ConfigurationProperties(prefix="person")
  • 测试
@Autowired
private Person person;

如果Person类上报错,在Pom文件中加入如下依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
</dependency>

4 处理动静态资源

4.1 动态资源

官网见:90.2 Reload Templates without Restarting the Container

  • templates

resources目录下有一个templates文件夹,可以将动态资源放到其中

  • 引入thymeleaf
<!--thymeleaf的jar包-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
  • templates下新建test.html文件
<html xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
    <span style="color:red; font-size:30pt" th:text="${str}"></span>
</body>
  • controller中return test
@Controller
@RequestMapping("/gupao")
public class GupaoController {
    @RequestMapping("/hello")
    public String hello(Model model){
        String str="hello spring boot";
        //想要动态的显示在网页当中
        model.addAttribute("str",str);
        //接下来的页面是能够动态显示传过来的数据
        return "test";
    }
}

4.2 静态资源

  • static文件夹

在resources目录下有一个static文件夹,可以将静态资源放到其中,浏览器可以直接访问。

  • 静态资源其他存放文件夹
"classpath:/META-INF/resources/"
"classpath:/resources/"
"classpath:/static/"
"classpath:/public/"
  • WebMvcAutoConfiguration源码分析

WebMvcAutoConfiguration--->WebMvcAutoConfigurationAdapter.addResourceHandlers(xxx)--->

this.resourceProperties.getStaticLocations()
return this.staticLocations;
private String[] staticLocations = CLASSPATH_RESOURCE_LOCATIONS;
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
      "classpath:/META-INF/resources/", "classpath:/resources/",
      "classpath:/static/", "classpath:/public/" };

  • 自定义静态资源文件夹

观察

@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
public class ResourceProperties {

配置application.properties

spring.resources.static-locations=classpath:/gupao/

5 整合MyBatis

5.1 需求

通过Spring Boot Web项目api接口的方式,整合MyBatis实现crud的操作。

5.2 创建Spring Boot Web项目

重温一下web项目创建的过程。

5.3 引入项目中需要的starter依赖

<dependency>
   <groupId>mysql</groupId>
   <artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
   <groupId>org.mybatis.spring.boot</groupId>
   <artifactId>mybatis-spring-boot-starter</artifactId>
   <version>1.3.1</version>
</dependency>
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

5.4 创建数据库表

db_gupao_springboot--->t_user

5.5 创建domain/User对象

public class User {
    private int id;
    private String username;
    private String password;
    private String number;
    ...
}

5.6 开发dao层

@Repository
@Mapper
public interface UserMapper {
    User find(String username);
    List<User> list();
    int insert(User user);
    int delete(int id);
    int update(User user);
}

5.7 开发service层

@Service
public class UserService {
    @Autowired
    public UserMapper userMapper;
    public User findByUsername(String username){
        return userMapper.find(username);
    }
    public List<User> listUser(){
        return userMapper.list();
    }
    public int insertUser(User user){
        return userMapper.insert(user);
    }
    public int updateUser(User user){
        return userMapper.update(user);
    }
    public int delete(int id){
        return userMapper.delete(id);
    }
}

5.8 开发controller层

@RestController
@RequestMapping(value="/user",method = {RequestMethod.GET,RequestMethod.POST})
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/listone")
    @ResponseBody
    public User listOne(String username){
        return userService.findByUsername(username);
    }
    @RequestMapping("/listall")
    @ResponseBody
    public List<User> listAll(){
        return userService.listUser();
    }

    @RequestMapping(value="/add",method= RequestMethod.POST)
    @ResponseBody
    public String add(User user){
        int result=userService.insertUser(user);
        if(result>=1) {
            return "添加成功";
        }else{
            return "添加失败";
        }
    }
    @RequestMapping(value="/update",method= RequestMethod.POST)
    @ResponseBody
    public String update(User user){
        int result=userService.updateUser(user);
        if(result>=1) {
            return "修改成功";
        }else{
            return "修改失败";
        }
    }
    @RequestMapping(value="/delete",method= RequestMethod.GET)
    @ResponseBody
    public String delete(int id){
        int result=userService.delete(id);
        if(result>=1) {
            return "删除成功";
        }else{
            return "删除失败";
        }
    }
}

5.9 resources目录下创建mapper文件夹---UserMapper.xml

<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE mapper PUBLIC
        "-//mybatis.org//DTD com.example.Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.csdn.springbootmybatis.dao.UserMapper">
    <resultMap id="result" type="com.gupao.springbootmybatis.domain.User">
        <result property="username" column="username"/>
        <result property="password" column="password"/>
        <result property="number" column="number"/>
    </resultMap>

    <select id="find" resultMap="result">
      SELECT * FROM t_user where username=#{username}
    </select>
    <select id="list" resultMap="result">
      SELECT * FROM t_user
   </select>
    <insert id="insert" parameterType="com.gupao.springbootmybatis.domain.User"
            keyProperty="id" useGeneratedKeys="true">
      INSERT INTO t_user
      (
      id,username,password,number
      )
      VALUES (
      #{id},
      #{username, jdbcType=VARCHAR},
      #{password, jdbcType=VARCHAR},
      #{number}
      )
   </insert>
    <delete id="delete" parameterType="int">
      delete from t_user where id=#{id}
   </delete>
    <update id="update" parameterType="com.gupao.springbootmybatis.domain.User">
   update t_user set user.username=#{username},user.password=#{password},user.number=#{number} where user.id=#{id}
   </update>
</mapper>

5.10 application.properties文件配置

#数据源
spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/boot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
#mybatis托管mapper文件
mybatis:
  mapper-locations: classpath:mapper/*.xml

5.11 启动项目测试

  • 查询

http://localhost:8888/user/listone?username=Jack

  • 全部查询

http://localhost:8888/user/listall

  • 增加

http://localhost:8888/user/add?id=3&username=AAA&password=111111&number=300

  • 更新

http://localhost:8888/user/update?id=3&username=BBB

  • 删除

http://localhost:8888/user/delete?id=3

6 项目打包

  • jar包

mvn -Dmaven.test.skip -U clean install

java -jar xxx.jar

  • war包
<groupId>com.csdn</groupId>
<artifactId>springboot-demo2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

7 Spring Boot in less than 10 minutes

https://www.youtube.com/watch?v=lhkwLtDIMHI&feature=youtu.be

BUILD ANYTHING WITH SPRING BOOT

Spring Boot is the starting point for building all Spring-based applications. Spring Boot is designed to get you up and running as quickly as possible, with minimal upfront configuration of Spring.

| | | | - | Get started in seconds using Spring Initializr | | - | Build anything: REST API, WebSocket, web, streaming, tasks, and more | | - | Simplified security | | - | Rich support for SQL and NoSQL | | - | Embedded runtime support: Tomcat, Jetty, and Undertow | | - | Developer productivity tools such as LiveReload and Auto Restart | | - | Curated dependencies that just work | | - | Production-ready features such as tracing, metrics, and health status | | - | Works in your favorite IDE: Spring Tool Suite, IntelliJ IDEA, and NetBeans |

7.1 IDEA创建工程

group:com.example

artifact:bootiful

dependencies:Reactive Web,Reactive MongoDB,Lombok,Actuator,Security

7.2 DATA DRIVE

Spring Data integrates seamlessly with SQL and NoSQL persistence stores. Spring Data supports reactive data access,too!

@Component
class DataWriter implements ApplicationRunner {
    private final CustomerRepository customerRepository;

    DataWriter(CustomerRepository customerRepository) {
        this.customerRepository = customerRepository;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        Flux.just("Jack", "Rechal", "Richard", "Jobs")
                .flatMap(name -> customerRepository.save(new Customer(null, name)))
                .subscribe(System.out::println);
    }
}
interface CustomerRepository extends ReactiveMongoRepository<Customer, String> {
}
@Document
@NoArgsConstructor
@Data
class Customer {
    private String id,name;

    public Customer(String id, String name) {
        this.id = id;
        this.name = name;
    }
}

7.3 REST

On the web,nobody knows you're a reactive microservice.

@SpringBootApplication
public class BootifulApplication {

    @Bean
    RouterFunction<ServerResponse> routes(CustomerRepository cr){
        return RouterFunctions.route(GET("/customers"),serverRequest -> ok().body(cr.findAll(),Customer.class));
    }

    public static void main(String[] args) {
        SpringApplication.run(BootifulApplication.class, args);
    }

}

7.4 OBSERVABILITY

How's your app's health?Who better to articulate that then the application itself?

Spring Boot featurese strong opinions,loosely held.

It's easy to change any of them with properties or pluggable implementations

management.endpoint.health.show-details=always
management.endpoints.web.exposure.exclude=*

@Bean
HealthIndicator healthIndicator(){
return () -> Health.status("I <3 Production").build();
}

访问:curl 
http://localhost:8080/actuator/health | jq

7.5 SECURITY

Effortlessly plugin authentication and authorization in a traditional or reactive application with Spring Security

@Bean
MapReactiveUserDetailsService users(){
    return new MapReactiveUserDetailsService(User.withDefaultPasswordEncoder().username("user").password("pw").roles("USER").build());
}

访问:curl -vu user:pw 
http://localhost:8080/customers | jq

7.6 TO PRODUCTION

Let's provision a MongoDB instance,configure our application's route and MongoDB binding,and then push our application to production with Cloud Foundry.

命令切换到bootiful根目录下

cf services

定位到my-mongodb文件夹

  • 复制对应文件,修改和观察

Spring Boot的这些基操你都会了嘛?总有一两个你还没掌握

 

Spring Boot的这些基操你都会了嘛?总有一两个你还没掌握

 

Spring Boot的这些基操你都会了嘛?总有一两个你还没掌握

 

Spring Boot的这些基操你都会了嘛?总有一两个你还没掌握

 

关注、点赞、转发是个好习惯哦~

 

 

SpringAI调用硅基流动免费模型 使用InMemoryChatMemory聊天记录的存储,可以让模型记住对话记录,结合上下文去回答,chatId就是会话窗口的id,在这个id不变的情况下,它会自定义的去在总结100条对话记录,然后再回答你的问题。新建一个Spring Boot的工程,在工程中引入Spring AI的依赖,Spring AI支持Ollma、类OpenAI的接口,这两个引入的pom不一样,这里示例中是使用的硅基流动的模型。这里使用的是硅基流动中Qwen/Qwen2.5-7B-Instruct模型,也可以其他的对话模型。 阅读详情

相关推荐

社区版IDEA也能爽写Spring Boot?手把手教你装Spring Boot Assistant插件搞定yml提示

本文深度评测Spring Boot Assistant插件如何为IntelliJ IDEA社区版用户提供接近专业版的Spring Boot开发体验。重点解析插件的YAML智能提示、项目创建向导和注解增强功能,并提供详细的安装配置指南与效率提升技巧,帮助开发者在不升级专业版的情况下提升Spring Boot开发效率。

chushang0934的博客 1142

pom.xml中project.reporting.outputEncoding

参考文档位置:https://cwiki.apache.org/confluence/display/MAVENOLD/Reporting+Encoding+Configuration Adding this element to the POM structure without breaking backward compatibility can only happen in

wen_t的博客 7527

使用Spring Boot Admin对Spring Boot项目进行监控

前言 Spring Boot Admin 是一款开源的用来监控服务状态的工具,核心是Spring Boot Actuator,Spring Boot Admin在其基础上,通过AngularJs对其实现了可视化的展现。Spring Boot Admin 由server和client两部分组成,为了实现监控的功能,我们需要实现一个server,而每一个被监控的Spring Boot 服务可以视为一个...

白鹭立雪的博客 4420

properties乱码,Transparent native-to-ascii conversion

1. 遇到的问题 2. 乱码产生的原因 3. 配置编码 4. Transparent native-to-ascii conversion 5. 为以后的项目也采用这个编码设置 1. 遇到的问题 properties中配置的国际化资源引发的乱码问题 2. 乱码产生的原因 默认情况下,项目中的配置文件编码跟随系统。 如下图,==配置文件跟随系统为GBK编码,而J...

Altsuki的博客 1万+

Spring MVC 与 Spring Boot 的差异到底在哪?

本文深入对比了传统SpringMVC与SpringBoot的核心差异。作者结合开发经验,从配置方式(XML到自动配置)、依赖管理(手动引入到Starter)、部署模式(外置Tomcat到内嵌容器)、外部化配置等方面进行剖析,指出SpringBoot通过自动配置砍掉了80%的模板代码,但同时也可能带来配置冲突等问题。文章强调SpringBoot并非替代SpringMVC,而是其"脚手架",底层仍依赖DispatcherServlet等核心组件。

无 598

从补码原理到实践:RISC-V中addi指令的符号扩展机制详解

本文深入解析了RISC-V架构中addi指令的符号扩展机制。从补码的数学原理出发,详细阐述了12位立即数在指令编码中如何通过符号位进行扩展,并结合lui指令,揭示了加载任意32位立即数的正确方法与实践陷阱,帮助开发者编写高效可靠的底层代码。

weixin_29161719的博客 143

修改maven打包编码格式设置

在pom中添加如下设置即可: <properties> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncod...

CHarit_Cilin的博客 4413

单细胞数据pseudobulks差异分析实战:从聚合到DESeq2

本文详细介绍了单细胞转录组数据分析中pseudobulks(伪散装)方法的实战流程。通过将同一样本的同类型细胞表达值聚合,模拟Bulk RNA-seq数据,再利用DESeq2进行稳健的差异基因分析。该方法有效降低了单细胞数据的技术噪音,特别适用于样本量有限但追求结果稳定性的研究场景,并提供了完整的R代码实现与结果解读指南。

sea99的博客 769

IDEA 使用maven编译,控制台出现乱码问题的解决方式

使用idea进行maven项目的编译时,控制台输出中文的时候出现乱码的情况。通常出现这样的问题,都是因为编码格式不一样导致的。既然是maven出的问题,我们在idea中查找下看可以如何设置文件编码。

A_aspectJ的博客 6933

obisidian插件之【templater】模板的中文说明书

Templater 是一种模板语言,可让您将变量和函数结果插入到笔记中。它还允许您执行操作这些变量和函数的 JavaScript 代码。使用 Templater,您将能够创建强大的模板来自动执行手动任务。

m0_55795604的博客 1万+

国内网络环境下Calico v3.26.4安装避坑指南(附华为云镜像加速脚本)

本文为国内开发者提供Calico v3.26.4的高效部署指南,重点介绍如何通过华为云镜像加速服务解决Kubernetes集群网络插件镜像拉取问题。文章包含详细的镜像加速脚本、部署清单修改方法及深度排错技巧,帮助开发者快速完成Calico网络插件的安装与配置。

brown的博客 296

Idea JAVA Maven项目 控制台常见的中文乱码问题解决方式

在pom.xml文件中,红框部分敲入以下代码。

UUUzbsmx的博客 4284

C#操作SQLite数据库帮助类——SQLiteHelper

using System; using System.Collections.Generic; using System.Data.SQLite; using System.Data; namespace Com.ZCWL.Rock.Helper { public class SQLiteHelper { private static string connectionString =

跟健哥出去走走 2万+

Spring-AI 接入(本地大模型 deepseek + 阿里云百炼 + 硅基流动)

Spring-AI 接入(本地大模型 deepseek + 阿里云百炼 + 硅基流动)

共同学习,共同成长! 2429

GPD源码分析

gpd使用示例 先看下面一段代码,为标准gpd算法的使用方法,可以看到输入为点云,cloud_camera_; 输入:std::unique_ptr<gpd::util::Cloud> cloud_camera_ 输出: std::vector<std::unique_ptr<gpd::candidate::Hand>> grasps; // detect grasp poses gpd对象:std::unique_ptr<gpd::GraspDetect.

weixin_41003113的博客 2335

如何在 SAP BTP 上通过 CDS view 快速创建 Fiori Elements 应用

本文基于 SAP Business Technology Platform 的 ABAP 编程环境进行的开发。 使用 ABAP Development Tool 登录 SAP BTP ABAP 编程环境,新建一个 package,命名为 Z_JERRY_CDS. 右键选中该 package,创建一个新的 Consumption view. 该视图是一个消费视图,它基于业务对象 (BO) 视图 /DMO/I_TRAVEL_U,提供了独立于消费层的给定数据模型。 它包含在其上运行的应用程序所需的所有核心信息。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 2033

新人一看就懂:Spring Boot+Spring mvc+Mybatis的基础框架demo

Spring Boot的设计目的是来简化新Spring应用的初始搭建以及开发过程,大大减少了代码量,通过这篇文章你可以清楚的看到。这是一个基于Spring Boot的简单demo,希望读者可以通过这篇文章大概能看懂这一个简单的框架搭建。后续我会陆续更新,微服务架构(Spring Boot、Spring Cloud)、分布式架构(Dobbo+Zookeeper)、大数据架构以及源码解析等相关的文章,感兴趣的话可以关注一下。

程序员云帆哥的博客 2万+

Eclipse邂逅Deepseek:本地化部署全攻略

通过前面一系列的步骤,我们成功地在 Eclipse 中完成了 Deepseek 的本地化部署,并且对部署后的功能进行了测试和优化,还解决了可能遇到的一些常见问题。这一过程不仅让我们体验到了将强大的大语言模型与高效的开发环境相结合的魅力,也为我们在软件开发过程中带来了诸多便利。本地化部署 Deepseek 到 Eclipse,使得我们在代码编写过程中能够获得智能的代码补全和精准的问答支持,大大提高了开发效率。同时,本地化部署保障了数据的安全性和隐私性,避免了数据在传输过程中可能面临的风险。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 4545

Spring和Spring Boot区别

spring和spring boot区别二者主要区别是:1、Spring Boot提供极其快速和简化的操作,让 Spring 开发者快速上手。2、Spring Boot提供了 Spring 运行的默认配置。3、Spring Boot为通用 Spring项目提供了很多非功能性特性。

qq_37904909的博客 2万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Spring Boot系列七 实现自己的spring boot starter工程

spring boot starter工程对于使用者是非常方便的,使用者通常只要在pom.xml引入starter的jar,则此工程依赖的类,就全部自动引入。因此我们常用的开源组件都会提供一个start工程给开发者,让开发者非常方便集成本组件到spring中。本文通过自己实现一个简单的demo,详细说明了如何实现一个自己的spring boot starter工程。

不积跬步无以至千里; 不积小流无以成江海 9427

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

玩转Spring Boot Actuator集成,基操,勿六!

前言 曾经看到Spring Boot Actuator这个框架时,一直在想,它到底有什么作用呢?虽然知道它提供了很多端点,有助于应用程序的监控和管理,但如果没有直接的实践案例,还是很难有说服力的。 直到上篇文章《微服务架构:Nacos本地缓存 PK 微服务优雅下线》中讲到可以利用其中Actuator定义的端点来达到微服务的优雅下线效果,才发现Actuator是真的很有用。 那么本文便基于Spring Boot系统如何集成Actuator,如何使用,以及如何自定义一个端点(Endpoint)来展开。

Java圈全能架构师的博客 385

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Spring Boot Spring MVC

Spring MVC 是一个基于模型-视图-控制器(MVC)模式的 Web 框架,提供了一整套处理 HTTP 请求的工具,包括控制器(Controller)、视图解析(View Resolver)和模型绑定(Model Binding)。

Flying_Fish_roe的博客 2055

spring-boot-starter-parent 与 spring-boot-dependencies区别

一、前言 我们平常时开发springboot项目时,pom文件中引入的依赖,总是少不了spring-boot-starter-parent 或 spring-boot-dependencies(仅其一),若未引入,会导致我们的项目缺包,今天我们来探讨一些两者的区别。 当我们使用 spring 或 spring-boot 开发项目时,需要引入很多依赖,包括 spring 本身的组件、各种 spring-boot-starter、以及其它第三方依赖(如:slf4j、redis)。 依赖多了,版本的选择是个问题,

weixin_41979002的博客 9978

Spring Boot详解

分享我的Spring Boot 笔记文档,本文档从Spring 的演变说起,根据文档一步一步学习,让您全面理解Spring Boot的工作原理,以及使用方法。可当做操作手册使用。 主要讲解内容有: 1、spring 的java配置方式; 2、Spring Boot 介绍; 3、搭建SpringBoot 应用 ; 4、Spring Boot自动配置原理; 5、Spring Boot的web开发;...

二总的猫 740

Spring Boot、Spring Cloud实现原理

Spring、Spring Boot、Spring Cloud实现原理

tszc95的博客 564

Spring Boot Demo基础篇:10分钟搭建你的第一个Spring Boot应用

Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。本文将以GitHub上的spring-boot-demo项目为例,带你快速上手Spring Boot应用的搭建。 ## 一、准备工作 在开始搭建Spring Boot应用之前,你需要确保以下工具和环境

gitblog_01404的博客 837
上一篇: LRU原理和Redis的LRU实现
下一篇: 一文教你轻松搞定JVM性能优化
java架构那些事
博客等级 码龄6年 6粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址