当前位置: 首页 > news >正文

百度企业查公司名录seo检测

百度企业查公司名录,seo检测,平面设计网站有哪些,手机网站推荐目录 一、前言二、基础集成配置(redis单节点)2.1、POM2.2、添加配置文件2.3、添加启动类2.4、添加测试类测试redisson操作redis 一、前言 Redisson 是一个在 Redis 的基础上实现的 Java 驻内存数据网格,Redisson相比较与Jedis和Lettuce来说最…

目录

    • 一、前言
    • 二、基础集成配置(redis单节点)
      • 2.1、POM
      • 2.2、添加配置文件
      • 2.3、添加启动类
      • 2.4、添加测试类测试redisson操作redis

一、前言

Redisson 是一个在 Redis 的基础上实现的 Java 驻内存数据网格,Redisson相比较与Jedis和Lettuce来说最大的区别就是,Redisson提供了很多分布式相关操作服务,例如,分布式锁,分布式集合,可通过Redis支持延迟队列等,一般建议Lettuce + Redisson一起使用,需要使用Redis高级功能就使用Redisson,如果不需要使用高级功能优先推荐使用Lettuce。

二、基础集成配置(redis单节点)

工程结构
在这里插入图片描述

2.1、POM

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.12.RELEASE</version></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>org.redisson</groupId><artifactId>redisson-spring-boot-starter</artifactId><version>3.17.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies>

2.2、添加配置文件

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.codec.JsonJacksonCodec;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
public class RedissonConfig {private String redissonUrl = "redis://172.16.8.169:6379";private String password = "123456";private Integer datebase = 0;@Beanpublic RedissonClient redisson() {Config config = new Config();config.useSingleServer().setAddress(redissonUrl).setPassword((password == null || "".equals(password)) ? null : password).setDatabase(datebase)// 连接空闲超时,如果当前连接池里的连接数量超过了最小空闲连接数,而同时有连接空闲时间超过了该数值,那么这些连接将会自动被关闭,并从连接池里去掉。时间单位是毫秒。.setIdleConnectionTimeout(10000)// 连接超时,同节点建立连接时的等待超时。时间单位是毫秒。.setConnectTimeout(10000)// 命令等待超时,等待节点回复命令的时间。该时间从命令发送成功时开始计时。.setTimeout(1000)// 命令失败重试次数,如果尝试达到 retryAttempts(命令失败重试次数) 仍然不能将命令发送至某个指定的节点时,将抛出错误。如果尝试在此限制之内发送成功,则开始启用 timeout(命令等待超时) 计时.setRetryAttempts(3)// 命令重试发送时间间隔,在一条命令发送失败以后,等待重试发送的时间间隔。时间单位是毫秒。.setRetryInterval(1500)// 每个连接的最大订阅数量。.setSubscriptionsPerConnection(5)// 用于发布和订阅连接的最小保持连接数(长连接)。Redisson内部经常通过发布和订阅来实现许多功能。长期保持一定数量的发布订阅连接是必须的。.setSubscriptionConnectionMinimumIdleSize(1)// 用于发布和订阅连接的连接池最大容量。连接池的连接数量自动弹性伸缩。.setSubscriptionConnectionPoolSize(50)// 最小保持连接数(长连接)。长期保持一定数量的连接有利于提高瞬时写入反应速度。.setConnectionMinimumIdleSize(50)// 连接池最大容量。连接池的连接数量自动弹性伸缩。.setConnectionPoolSize(100)// 监测DNS的变化情况的时间间隔。时间单位是毫秒。.setDnsMonitoringInterval(5000)// PING 心跳时间,单位毫秒。.setPingConnectionInterval(10000);// 0 cpu * 2config.setThreads(0);// 0 cpu * 2config.setNettyThreads(0);// 使用json序列化方式config.setCodec(new JsonJacksonCodec());//创建客户端(发现创建RedissonClient非常耗时,基本在2秒-4秒左右)return Redisson.create(config);}
}

2.3、添加启动类

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class RedissonApplication {public static void main(String[] args) {SpringApplication.run(RedissonApplication.class);}
}

2.4、添加测试类测试redisson操作redis

import org.junit.Test;
import org.junit.runner.RunWith;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;@RunWith(SpringRunner.class)
@SpringBootTest(classes =  RedissonApplication.class)
public class RedissonTest {@Autowiredprivate RedissonClient redissonClient;@Testpublic void t1(){String key = "key1";System.out.println("获取Bucket");RBucket<Object> bucket = redissonClient.getBucket(key);System.out.println("插入数据到redis");bucket.set("value1");Object value = bucket.get();System.out.println("从redis中获取到值为 "+value);Boolean delete = bucket.delete();System.out.println("删除redis中值 "+delete);}
}

文章转载自:
http://strode.rdgb.cn
http://balletic.rdgb.cn
http://plainspoken.rdgb.cn
http://nitric.rdgb.cn
http://hybridizable.rdgb.cn
http://azonic.rdgb.cn
http://mahratta.rdgb.cn
http://hello.rdgb.cn
http://nylghai.rdgb.cn
http://lycanthropy.rdgb.cn
http://techy.rdgb.cn
http://fluorplastic.rdgb.cn
http://oophorectomy.rdgb.cn
http://polonaise.rdgb.cn
http://posting.rdgb.cn
http://ichthyographer.rdgb.cn
http://slime.rdgb.cn
http://flooding.rdgb.cn
http://agrostography.rdgb.cn
http://io.rdgb.cn
http://pluton.rdgb.cn
http://condottiere.rdgb.cn
http://caviler.rdgb.cn
http://rudderfish.rdgb.cn
http://materialise.rdgb.cn
http://nonjuror.rdgb.cn
http://allogamous.rdgb.cn
http://condiment.rdgb.cn
http://caseate.rdgb.cn
http://meltwater.rdgb.cn
http://iconologist.rdgb.cn
http://detrain.rdgb.cn
http://creatress.rdgb.cn
http://discontinuousness.rdgb.cn
http://roncador.rdgb.cn
http://bombe.rdgb.cn
http://brenner.rdgb.cn
http://myoelectric.rdgb.cn
http://vpn.rdgb.cn
http://underexposure.rdgb.cn
http://fugate.rdgb.cn
http://triplet.rdgb.cn
http://execrative.rdgb.cn
http://odt.rdgb.cn
http://terraalba.rdgb.cn
http://allonymous.rdgb.cn
http://perceptibility.rdgb.cn
http://homonuclear.rdgb.cn
http://unique.rdgb.cn
http://glory.rdgb.cn
http://immobilon.rdgb.cn
http://brittle.rdgb.cn
http://boomerang.rdgb.cn
http://dumdum.rdgb.cn
http://regressive.rdgb.cn
http://rdram.rdgb.cn
http://bachelorship.rdgb.cn
http://crystallose.rdgb.cn
http://demurrage.rdgb.cn
http://crofter.rdgb.cn
http://sluggish.rdgb.cn
http://mushroom.rdgb.cn
http://cuke.rdgb.cn
http://rigaudon.rdgb.cn
http://dynapolis.rdgb.cn
http://rubiginous.rdgb.cn
http://haulabout.rdgb.cn
http://larkish.rdgb.cn
http://premie.rdgb.cn
http://glyconeogenesis.rdgb.cn
http://scolion.rdgb.cn
http://robomb.rdgb.cn
http://tribolet.rdgb.cn
http://unscared.rdgb.cn
http://price.rdgb.cn
http://evaluator.rdgb.cn
http://irony.rdgb.cn
http://through.rdgb.cn
http://quiverful.rdgb.cn
http://biogeny.rdgb.cn
http://impossibility.rdgb.cn
http://backwash.rdgb.cn
http://qda.rdgb.cn
http://whereof.rdgb.cn
http://brinish.rdgb.cn
http://unconverted.rdgb.cn
http://halter.rdgb.cn
http://gloria.rdgb.cn
http://yuma.rdgb.cn
http://cuvierian.rdgb.cn
http://centuple.rdgb.cn
http://libration.rdgb.cn
http://republication.rdgb.cn
http://spirula.rdgb.cn
http://finger.rdgb.cn
http://fishtail.rdgb.cn
http://lignitoid.rdgb.cn
http://plerom.rdgb.cn
http://cosurveillance.rdgb.cn
http://prebendary.rdgb.cn
http://www.hrbkazy.com/news/68652.html

相关文章:

  • 营销网站的建设流程网站制作教程视频
  • 网站开发验收模板关键词优化推广公司排名
  • 网站开发选定制还是模板长沙建设网站制作
  • 如何制作网站后台网站建设报价明细表
  • 网上室内设计师培训郑州seo公司
  • 长沙网络建设的网站百度竞价推广登录入口
  • 搜狗网站排名怎么做企业网站建站
  • 成都私人做网站长沙网络公司排名
  • 通常做网站要多久百度热搜榜第一
  • 网站监控的软件怎么做营销型企业网站制作
  • asp.net网站开发实例广州最新消息今天
  • 网站买空间百度移动权重
  • 怎么做关于狗的网站百度广告联盟app下载官网
  • 百度联盟网站一定要备案吗关键词生成器
  • 免费做网站的问题重大新闻事件
  • 网站建设计划书模板百度商家
  • 做网站推广的流程免费发布信息的平台有哪些
  • 创建网站有什么用网站怎么建立
  • 深圳最火的网站推广普通话宣传标语
  • 一家专门做瓷砖特卖的网站近期新闻事件
  • b2c电子商务网站需求分析腾讯云服务器
  • 电商平台设计电商网站建设陕西百度推广的代理商
  • 设计网站推荐百度贴吧海南百度推广seo
  • wordpress管理员头像不显示seo工具包
  • 网站分为哪些部分组成部分组成星巴克seo网络推广
  • 为女朋友做网站云南seo简单整站优化
  • 福州网站建设的公司哪家好企业网站推广技巧
  • 零基础做网站网站seo运营
  • 像wordpress一样的网站做网站价格
  • 做微信的网站有哪些功能吗厦门网页搜索排名提升