
后端
ghx123456ghx
这个作者很懒,什么都没留下…
展开
-
shiro整合redis,使用redis缓存和session共享
一 shiro整合原理 shiro整合redis分2个部分,1 session管理使用redis管理 2 cache缓存管理使用redis管理。如下通过2种方式实现二 springboot自带的加入pom依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</a原创 2020-07-16 18:48:14 · 786 阅读 · 0 评论 -
shiro同一账号登录次数限制
一 shiro整合kickoutSessionFilter1 注入kickoutSessionFilter<bean id="kickoutSessionFilter" name="kickoutSessionFilter" class="com.msunsoft.listener.KickoutSessionFilter"> <property name="cacheManager" ref="shiroCacheManager"></property>原创 2020-07-14 12:44:08 · 571 阅读 · 0 评论 -
springboot学习笔记
一 加载配置文件内容1.1 普通读取1.1.1 class文件@Configuration@PropertySource("classpath:jdbc.properties")public class JdbcConfig { @Value("${jdbc.driver}") String driverClassName; @Value("${jdbc.u...原创 2020-03-16 22:17:53 · 497 阅读 · 0 评论 -
nginx分布式集群中使用websocket,(redis订阅)
一 前言1.1 原理websocket核心是将握手成功的session信息存入到静态变量中,但是分布式中有很多个服务器,tomcat,使用nginx转发到不同的tomcat中,就不能保证此tomcat存储着握手成功的session信息,因此可以使用redis订阅功能,当发送消息时可以使用redis订阅,发送到已经订阅过该频道的服务器,从每个服务器中查找是否有接收人的session信息,有就发送...原创 2020-03-16 18:39:20 · 1420 阅读 · 0 评论 -
spring配置多数据源
一 ApplicationContext.xml中配置1 配置数据源<!--start 数据源配置 --><bean id="propertyConfigurer" class="com.msunsoft.datasource.EncryptPropertyPlaceholderConfigurer"> <property name="locations"&...原创 2020-01-06 12:46:24 · 181 阅读 · 0 评论