共 20 篇文章 |
|
} public SchedulingRunnable(String beanName, String methodName, String params) { this.beanName = beanName;添加定时任务示例类@Component(''''''''demoTask'''''''')public class DemoTask { public void taskWithParams(String params) { System.... 阅49 转0 评0 公众公开 20-02-19 08:22 |
Spring Cloud是一系列框架的有序集合。早期的Spring Cloud Eureka在注册获取网卡IP时,不能区分外网网卡和内网网卡,如果安装了虚拟机和docker也不能区分虚拟网卡,每次启动注册的IP都有可能不一样,如果要注册为外网网卡IP,那运行带宽就不够,这个bug应该说是比较严重的问题,因此重写了网卡IP获取的逻辑来解决,同时也反馈给了spring cloud... 阅61 转0 评0 公众公开 17-12-25 10:14 |
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency></dependencies><build> <plugins> <plugin> <groupId>org.springframework.boot<... 阅162 转0 评0 公众公开 17-06-20 17:07 |
MongoDB文档与JSON对象类似。<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId></dependency><dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId></dependency>... 阅95 转1 评0 公众公开 17-06-20 17:06 |
try { //true表示需要创建一个multipart message MimeMessageHelper helper = new MimeMessageHelper(message, true); helper.setFrom(from); helper.setTo(to); helper.setSubject(subject); helper.setText(content, true); mailSender.send(message); logger.info("html邮件发送成功"); } catch (MessagingException e) { logger.... 阅41 转1 评0 公众公开 17-06-20 17:06 |
springboot(九):定时任务。this is scheduler task runing 0现在时间:09:44:17this is scheduler task runing 1现在时间:09:44:23this is scheduler task runing 2现在时间:09:44:29this is scheduler task runing 3现在时间:09:44:35参数说明。 阅72 转2 评0 公众公开 17-06-20 17:06 |
通常我们谈到队列服务, 会有三个概念: 发消息者、队列、收消息者,RabbitMQ 在这个基本概念之上, 多做了一层抽象, 在发消息者和 队列之间, 加入了交换器 (Exchange). 这样发消息者和队列就没有直接联系, 转而变成发消息者把消息给交换器, 交换器根据调度策略再把消息再给队列。交换机(Exchange)Direct ExchangeDirect Exchange是RabbitMQ默认... 阅25 转0 评0 公众公开 17-06-20 17:05 |
@Configuration@MapperScan(basePackages = "com.neo.mapper.test1", sqlSessionTemplateRef = "test1SqlSessionTemplate")public class DataSource1Config { @Bean(name = "test1DataSource") @ConfigurationProperties(prefix = "spring.datasource.test1") @Primary public DataSource testDataSou... 阅61 转1 评0 公众公开 17-06-20 17:05 |
spring boot(六):如何优雅的使用mybatis.官方说明:MyBatis Spring-Boot-Starter will help you use MyBatis with Spring Boot其实就是myBatis看spring boot这么火热也开发出一套解决方案来凑凑热闹,但这一凑确实解决了很多问题,使用起来确实顺畅了许多。<dependency> <groupId>org.mybatis.spring.boot</groupId> <art... 阅34 转0 评0 公众公开 17-06-20 17:04 |
spring boot(五):spring data jpa的使用。spring data jpa介绍首先了解JPA是什么?spring data jpa.Spring Data JPA 是 Spring 基于 ORM 框架、JPA 规范的基础上封装的一套JPA应用框架,可使开发者用极简的代码即可实现对数据的访问和操作。分页查询在实际使用中非常普遍了,spring data jpa已经帮我们实现了分页的功能,在查询的方法中,需要... 阅26 转1 评0 公众公开 17-06-20 17:04 |