随笔分类 - Spring
摘要:1 添加Redis依赖 引入需要集成的redis版本 <!--spring redis 2.8.2 start--> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> <
阅读全文
摘要:1 背景 由于项目中使用的spring版本比较低,无法很好支持某些功能的使用,于是决定将spring3升级为spring4 2 升级spring版本 修改前:<spring.version>3.1.1.RELEASE</spring.version> 修改后 :<spring.version>4.3
阅读全文
摘要:1.背景 由于业务需求最近准备将系统中原有的memcached改造为Redis,实现多数据类型的分布式缓存。 2.分布式缓存: 3.集成改造 1) Pom依赖 vcsp-genericProfessionServer\pom.xml <dependency> <groupId>org.apache.
阅读全文
摘要:到logstash-2.0.0\bin下新建文件 logstash.conf input { tcp { mode => "server" host => "0.0.0.0" port => 4560 codec => json_lines } } output { elasticsearch {
阅读全文
摘要:注: 该集成方式,对Elasticsearch无版本限制,但是需要自行封装请求,解析结果等。 <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-client</artifac
阅读全文
摘要:1.ELK介绍 1> Elasticsearch是实时全文搜索和分析引擎, 提供搜集、分析、存储数据三大功能; 是一套开放REST和JAVA API等结构提供高效搜索功能,可扩展的分布式系统。 2> Logstash是一个用来搜集、分析、过滤日志的工具。 它支持几乎任何类型的日志,包括系统日志、错误
阅读全文
摘要:Sspring bean被初始化加载2次 spring框架的web项目时,启动的时候发现某个bean被加载了两次,比如使用SchedulingConfigurer或者使用@PostConstruct的方法都被执行了2次 web.xml 配置 1、问题: ContextLoaderListener和D
阅读全文
摘要:Spring中lazy-init详解ApplicationContext实现的默认行为就是在启动服务器时将所有singleton bean提前进行实例化(也就是依赖注入)。提前实例化意味着作为初始化过程的一部分,applicationContext实例会创建并配置所有的singleton bean。
阅读全文
摘要:Overview I’ve been asked several times to explain the difference between injecting Spring beans with ‘@Resource’, ‘@Autowired’, and ‘@Inject’. While I
阅读全文