scheduling springboot execution task

springboot集成Redis

2023.9.5 1.springboot集成Redis,可以实现RedisCallback 这个接口完成一次连接/Redis事务执行多个命令的功能,这个比较底层,还有一个封装的更好一点的接口叫SessionCallback,也可以实现一次连接多个命令的效果。具体可以参考网上一些资料,这里记录一下。 ......
springboot Redis

Hello 2023 B. MKnez's ConstructiveForces Task

构造一个数组 $a_1, a_2, \cdots, a_n$ 满足以下条件 * $\forall i \in[1, n],\ a_i \neq 0$ 。 * $\forall i \in [1, n - 1], a_i + a_{i + 1} = \sum_{i = 1}^{n} a_i$ 。 显然 ......
ConstructiveForces Hello MKnez 2023 Task

springboot~InvocationHandler中为什么不能使用@Autowired

`@Autowired` 是 Spring Framework 中用于自动注入依赖的注解,通常情况下可以正常工作,但有一些情况下可能无法获取到 bean 对象: 1. **Bean未定义或未扫描到**:如果要注入的 bean 没有在 Spring 上下文中定义或者没有被正确扫描到,`@Autowir ......
InvocationHandler springboot Autowired

Springboot+Quartz+Dynamic-datasource

本文主要解决Springboot项目下Quartz和Dynamic-datasource集成过程中的一些问题。包括: 1. 多数据源下Quartz持久化配置:quartz数据库配置,执行参数配置。 2. 采用Controller层调用自定义的JobService的方式,对定时任务进行初始化和动态调度... ......

SpringBoot几个常用的注解

(1)@RestController和@Controller指定一个类,作为控制器的注解 (2)@RequestMapping方法级别的映射注解,这一个用过Spring MVC的小伙伴相信都很熟悉 (3)@EnableAutoConfiguration和@SpringBootApplication是 ......
注解 SpringBoot 常用

springboot加载bean失败:No matching autowired candidates found

场景: 之前在培训轮岗,一直没有干活,最近开始干活遇到xxljob,打算自己学习了解一下。在按照文档配置执行器项目时,发现怎么启动,xxlJobExecutor都没有被加载进来。 解决: 后来经过查阅,原来是springBoot启动默认扫描的是启动类所在的包以及其子包,而我的文件为:因此bean注入 ......

SpringBoot+Nacos+Gateway实现一个端口调用多个不同服务

目录: 1.SpringBoot+Nacos+OpenFeign实现服务的注册、发现、远程调用 2.SpringBoot+Nacos+Gateway实现一个端口调用多个不同服务 一、概述(需要结合上一篇进行观看) 上一篇博客实现了Nacos+openFeign实现了服务之间远程接口的调用。这一篇用网 ......
端口 SpringBoot 多个 Gateway Nacos

springboot 小记

启动类扫描 1.Mapper层使用@Mapper注解; 点击查看代码 ``` package com.hidisp; import com.hidisp.entity.User; import com.hidisp.mapper.UserMapper; import org.junit.jupite ......
小记 springboot

给你的 SpringBoot 工程部署的 jar 包瘦瘦身吧!

之前有写过一篇有关maven插件的文章:[spring-boot-maven-plugin插件详解](https://mp.weixin.qq.com/s/Z7yHLCeF9_us1qJnVIRvww) ## 一、需求背景 我们知道Spring Boot项目,是可以通过`java -jar 包名` ......
SpringBoot 工程 jar

weighted job schedule 1235

1235. Maximum Profit in Job Scheduling Hard 539662Add to ListShare We have n jobs, where every job is scheduled to be done from startTime[i] to endTim ......
weighted schedule 1235 job

SpringBoot项目报java.lang.IllegalStateException: Cannot load configuration class: com.imooc.demo.DemoApplication

报错摘要: java.lang.IllegalStateException: Cannot load configuration class: com.imooc.demo.DemoApplication, Caused by: java.lang.ExceptionInInitializerErr ......

future task cancel

//有一个入参,需要说明task是否是可中断的 public boolean cancel(boolean mayInterruptIfRunning) { if (state != NEW) return false; if (mayInterruptIfRunning) { //尝试修改futu ......
future cancel task

mysql 创建定时器,每天晚上1点钟调用存储过程proc_task

在 MySQL 中,你可以使用事件调度器(Event Scheduler)来创建定时器,以在指定时间自动执行存储过程。以下是在每天晚上1点钟调用存储过程proc_task的示例: 首先,确保 MySQL 事件调度器已经启用。如果尚未启用,可以在 MySQL 客户端中执行以下命令: ``` SET G ......
定时器 proc_task 过程 mysql proc

SpringBoot+Nacos+OpenFeign实现服务的注册、发现、远程调用

一、概述 微服务的开发必定会用到SpringBoot、Nacos(服务发现、注册、配置中心)、OpenFeign(服务远程调用,也就是通过注解调用其他服务的接口)。今天写这篇是想把这三个功能集成在一起。 让他们一起参与微服务的开发工作。 要实现的目标:nacos要能够注册及发现服务,openfeig ......
SpringBoot OpenFeign Nacos

SpringBoot 读取配置文件

1. 在resources文件下创建新的配置文件,如test.yml: ```yml es: name: elasticsearch ``` 2. 准备使用@PropertySource注解来读取test.yml内容,但@PropertySource本身不支持yml文件,所以创建以下类: ```ja ......
SpringBoot 文件

SpringBoot 下使用Swagger3.0

swagger3.0和2.x的版本有一些配置是不一样的,故记录下。 ## pom.xml依赖 ```xml io.springfox springfox-boot-starter 3.0.0 ``` ## Config.java内容 ```java @Configuration @EnableSwa ......
SpringBoot Swagger3 Swagger

SpringBoot 3 项目快速构建

SpringBoot 3 项目快速构建如何快速搭建一个简单的SpringBoot项目 使用SpringBoot官方提供的脚手架工具Spring Initializr 使用阿里云提供的脚手架工具阿里云脚手架 本文使用阿里云脚手架工具来搭建一个简单的SpringBoot项目 1.打开阿里云脚手架工具构建 ......
SpringBoot 项目

SpringBoot--实用开发

# SpringBoot实用开发 ## 热部署 热部署是指在你修改项目BUG的时候对JSP或JAVA类进行了修改在不重启WEB服务器前提下能让修改生效。但是对配置文件的修改除外! 导入springboot开发者工具坐标: ```xml org.springframework.boot spring- ......
SpringBoot

SpringBoot--运维实用

# SpringBoot运维实用篇 ## 打包与运行 ### windows打包 ![](https://img2023.cnblogs.com/blog/2844064/202309/2844064-20230904132503013-1558605397.png) 在maven中双击packag ......
SpringBoot

SpringBoot--基础

# SpringBoot--基础 - SpringBoot的设计目的是用来简化Spring应用的初始搭建以及开发过程 ## idea创建springboot入门步骤(需要idea联网) 1. 创建一个空项目 2. 之后再项目构建中添加springboot相关配置 ![](https://img202 ......
SpringBoot 基础

Scheduling and Resource Allocation

Module aims Real-life problems arising in computer science, computational management and economics often involve deciding the best way to use a given ......
Scheduling Allocation Resource and

idea 新建springboot mave 项目

1 idea 新建项目 2 选择springboot 版本以及相关配置 创建好项目 3 设置项目配置 4 初始化的项目结构如下 5 新建IndexController package com.example.demo.controller; import org.springframework.we ......
springboot 项目 idea mave

20230526 java.lang.reflect.Executable

## 介绍 - `java.lang.reflect.Executable` - `public abstract sealed class Executable extends AccessibleObject implements Member, GenericDeclaration permi ......
Executable 20230526 reflect java lang

SOFABoot和Springboot的关系

SOFABoot 也是 SOFA 技术栈体系中一个框架,但和 SOFARPC 没有直接关系,SOFABoot 是一个 Spring Boot 加强版,还提供了方便使用 SOFA 中间件的能力,SOFARPC 只是其中之一而已。 二、功能描述Spring Boot 虽然是一个非常优秀的主流开源框架,但 ......
Springboot SOFABoot

springboot自动配置的原理和如何自定义starter

## 一、springboot自动配置的原理 使用springboot时的一大优点就是当需要引入一些第三方的框架时只需要引入一个对应的starter后springboot就会自动的完成配置,例如在springboot中使用mybatis只需要引入mybatis提供的starter. 那么这种便捷的配 ......
springboot 原理 starter

springboot的管理系统连接虚拟机数据库

# 1、在配置文件里面进行更改 原来的localhost更改为:虚拟机的IP地址:3306 用户名密码更改为:Linux系统**MYSQL的帐号密码** ![](https://img2023.cnblogs.com/blog/2808014/202309/2808014-2023090315111 ......

SpringBoot管理系统连接虚拟机MYSQL数据库

# 1、使用Navicat软件连接虚拟机 ip地址填写虚拟机的:192.168.158.129; 密码填写虚拟机的mysql的密码:wingkin45; 发现弹出这样一个提示框: ![](https://img2023.cnblogs.com/blog/2808014/202309/2808014- ......

springboot - 整合redis

1.引入pom依赖 <!-- redis --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency>< ......
springboot redis

SpringBoot集成redis集群

1、添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <exclusions> <!-- 过滤lettuce,使用 ......
集群 SpringBoot redis

基于SpringBoot框架实现策略设计模式

策略设计模式属于行为设计模式,这种模式可以使得程序在运行的时候,可以根据场景动态的选择适合的策略逻辑去执行,并且根据不同的需求可以去新增、修改不同的策略逻辑,具有极强的扩展性、可维护性 前几日面试,遇见这么一个业务场景: 饮品订单计价实现 饮品店有6种饮品出售: 椰果奶茶:10元 西米奶茶:10元 ......
设计模式 SpringBoot 框架 策略 模式