随笔分类 -  java

上一页 1 2 3 4 5 6 ··· 9 下一页
摘要:如何解决spring boot中的 Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it to the c 阅读全文
posted @ 2022-08-05 14:21 浅笑19 阅读(1404) 评论(0) 推荐(0) 编辑
摘要:@Queue注解为我们提供了队列相关的一些属性,具体如下: name: 队列的名称; durable: 是否持久化; exclusive: 是否独享、排外的; autoDelete: 是否自动删除; arguments:队列的其他属性参数,有如下可选项,可参看图2的arguments: x-mess 阅读全文
posted @ 2022-07-20 13:52 浅笑19 阅读(6215) 评论(0) 推荐(0) 编辑
摘要:rabbitmq 默认路由说明 amq.rabbitmq.trace 说明:firehose的机制是将生产者投递给rabbitmq的消息,rabbitmq投递给消费者的消息按照指定的格式发送到默认的exchange上。这个默认的exchange的名称为amq.rabbitmq.trace,它是一个t 阅读全文
posted @ 2022-07-06 11:08 浅笑19 阅读(47) 评论(0) 推荐(0) 编辑
摘要:添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> 添加配置 package org.qx 阅读全文
posted @ 2022-06-14 19:40 浅笑19 阅读(726) 评论(0) 推荐(0) 编辑
摘要:原文出处:https://blog.51cto.com/u_15288542/3030781 阅读全文
posted @ 2022-06-08 16:48 浅笑19 阅读(189) 评论(0) 推荐(0) 编辑
摘要:接口 //接口 public interface Shape { void draw(); } 实现 //实现1 @Service public class Rectangle implements Shape { @Override public void draw() { System.out. 阅读全文
posted @ 2022-06-08 16:40 浅笑19 阅读(184) 评论(0) 推荐(0) 编辑
摘要:// 忽略全部类型的警告 @SuppressWarnings("all") // 忽略未检查的转化,例如集合没有指定类型的警告 @SuppressWarnings("unchecked") // 忽略未使用的变量的警告 @SuppressWarnings("unused") // 忽略与使用Clos 阅读全文
posted @ 2022-06-08 16:30 浅笑19 阅读(1474) 评论(0) 推荐(0) 编辑
摘要:@Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) // 详细定制 .apiInfo(apiInfo()).select().apis(RequestHandlerSelectors 阅读全文
posted @ 2022-06-08 16:26 浅笑19 阅读(506) 评论(0) 推荐(0) 编辑
摘要:简单示例 public static void test10(){ // 创建JavaScript引擎 ScriptEngine jsEngine = new ScriptEngineManager().getEngineByName("js"); // ScriptEngine jsEngine 阅读全文
posted @ 2022-06-08 16:25 浅笑19 阅读(2207) 评论(0) 推荐(0) 编辑
摘要:方法一: @Autowired private RedisTemplate redisTemplate; /** * 事务方式一 */ @Test void testTransaction(){ //开启事务支持 //记得开启事务支持,但是不知道为何,我已经开启了,结果还是出现“ ERR EXEC 阅读全文
posted @ 2022-05-31 12:10 浅笑19 阅读(275) 评论(0) 推荐(0) 编辑
摘要:1、首先创建异常处理类 @Component public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler { private final Logger logger = LoggerFactory.getLo 阅读全文
posted @ 2022-05-20 19:03 浅笑19 阅读(680) 评论(0) 推荐(0) 编辑
摘要:1.背景 老项目是mybatis的,但是新项目想使用mybatis-plus, 故需要升级 2.实现步骤 2.1、删除所有的mybatis包,一定要去除所有的mybatis包。包括其他依赖内的依赖 2.2、导入mybatis-plus包 <dependency> <groupId>com.baomi 阅读全文
posted @ 2022-05-10 19:09 浅笑19 阅读(720) 评论(0) 推荐(0) 编辑
摘要:错误原因 缺少模板依赖 <!-- 模板引擎 --> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-engine-core</artifactId> <version>2.0</version> </d 阅读全文
posted @ 2022-05-09 10:52 浅笑19 阅读(87) 评论(0) 推荐(0) 编辑
摘要:解决办法:在启动类加一个注解:@EnableWebMvc 阅读全文
posted @ 2022-05-08 13:54 浅笑19 阅读(79) 评论(0) 推荐(0) 编辑
摘要:exchange方法提供统一的方法模板进行四种请求:POST,PUT,DELETE,GET 1、POST请求 String reqJsonStr = "{\"code\":\"testCode\", \"group\":\"testGroup\",\"content\":\"testContent\ 阅读全文
posted @ 2022-05-03 13:15 浅笑19 阅读(193) 评论(0) 推荐(0) 编辑
摘要:1、对象转json字符串 import com.fasterxml.jackson.databind.ObjectMapper; public class Main { public static void main(String[] arges) throws Exception { Object 阅读全文
posted @ 2022-05-03 13:10 浅笑19 阅读(134) 评论(0) 推荐(0) 编辑
摘要:在进行序列化如何过滤为null的属性,empty的属性,或者default的属性 一、全局注册; objectMapper.setSerializationInclusion(Include.ALWAYS) 二、具体类上打注解 @JsonSerialize(include = Inclusion.N 阅读全文
posted @ 2022-05-03 13:01 浅笑19 阅读(152) 评论(0) 推荐(0) 编辑
摘要:开启注解 @EnableScheduling // 开启同步定时任务 @EnableAsync // 开启异步 定时任务使用注解 @Component @Slf4j public class TestTask { // 同步定时任务 @Scheduled(cron = "0 * * * * ?") 阅读全文
posted @ 2022-04-29 11:15 浅笑19 阅读(337) 评论(0) 推荐(0) 编辑
摘要:@Conditional的用法 package com.condition; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.Conditio 阅读全文
posted @ 2022-04-17 21:39 浅笑19 阅读(63) 评论(0) 推荐(0) 编辑
摘要:<select id="queryRuralCodes" resultType="string" parameterType="map" useCache="false"> select id from <choose> <when test="type == '1'.toString()"> t1 阅读全文
posted @ 2022-04-14 15:46 浅笑19 阅读(163) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 9 下一页
点击右上角即可分享
微信分享提示