网站备案查询官网入口不为建盏公司简介

张小明 2026/3/12 11:38:50
网站备案查询官网入口,不为建盏公司简介,中国进出口贸易网官网,银川哪里做网站1. Redis实现定时消息通知 简单定时任务通知: 利用redis的keyspace notifications(即:键过期后事件通知机制) 开启方法 修改server.conf文件#xff0c;找到notify-keyspace-events , 修改为“Ex”使用cli命令: redis-cli config set notify-keyspace-events Ex redis 配置…1. Redis实现定时消息通知简单定时任务通知: 利用redis的keyspace notifications(即:键过期后事件通知机制)开启方法修改server.conf文件找到notify-keyspace-events , 修改为“Ex”使用cli命令:redis-cli config set notify-keyspace-events Exredis 配置参考2. 例子创建springboot项目修改pom.xml 和 ymlpom.xml?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd modelVersion4.0.0/modelVersion parent groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-parent/artifactId version2.6.9/version !-- 这个版本其实还是挺重要的如果是2.7.3版本的话大概会无法成功自动装载 RedisConnectionFactory -- relativePath/ !-- lookup parent from repository -- /parent groupIdcn.lazyfennec/groupId artifactIdredisdemo/artifactId version0.0.1-SNAPSHOT/version nameredisdemo/name descriptionDemo project for Spring Boot/description properties java.version1.8/java.version /properties dependencies dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-data-redis/artifactId /dependency dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-web/artifactId /dependency dependency groupIdorg.projectlombok/groupId artifactIdlombok/artifactId optionaltrue/optional /dependency dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-test/artifactId scopetest/scope /dependency /dependencies build plugins plugin groupIdorg.springframework.boot/groupId artifactIdspring-boot-maven-plugin/artifactId configuration excludes exclude groupIdorg.projectlombok/groupId artifactIdlombok/artifactId /exclude /excludes /configuration /plugin /plugins /build /projectapplication.ymlspring: redis: database: 0 host: 192.168.1.7 port: 6379 jedis: pool: max-active: 8 max-idle: 8 min-idle: 0 max-wait: 1创建RedisConfigpackage cn.lazyfennec.redisdemo.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; /** * Author: Neco * Description: * Date: create in 2022/9/20 23:19 */ Configuration EnableCaching public class RedisConfig { Bean public RedisTemplateString, Object redisTemplate(RedisConnectionFactory redisConnectionFactory) { // 设置序列化 Jackson2JsonRedisSerializerObject jackson2JsonRedisSerializer new Jackson2JsonRedisSerializerObject(Object.class); ObjectMapper om new ObjectMapper(); om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); jackson2JsonRedisSerializer.setObjectMapper(om); // 配置redisTemplate RedisTemplateString, Object redisTemplate new RedisTemplate(); redisTemplate.setConnectionFactory(redisConnectionFactory); RedisSerializer stringSerializer new StringRedisSerializer(); redisTemplate.setKeySerializer(stringSerializer); // key 序列化 redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); // value 序列化 redisTemplate.setHashKeySerializer(stringSerializer); // Hash key 序列化 redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); // Hash value 序列化 redisTemplate.afterPropertiesSet(); return redisTemplate; } }创建RedisListenerConfigurationpackage cn.lazyfennec.redisdemo.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.listener.RedisMessageListenerContainer; /** * Author: Neco * Description: * Date: create in 2022/9/21 11:02 */ Configuration public class RedisListenerConfiguration { Autowired private RedisConnectionFactory factory; Bean public RedisMessageListenerContainer redisMessageListenerContainer() { RedisMessageListenerContainer redisMessageListenerContainer new RedisMessageListenerContainer(); redisMessageListenerContainer.setConnectionFactory(factory); return redisMessageListenerContainer; } }事件监听事件 RedisTaskpackage cn.lazyfennec.redisdemo.task; import org.springframework.data.redis.connection.Message; import org.springframework.data.redis.listener.KeyExpirationEventMessageListener; import org.springframework.data.redis.listener.RedisMessageListenerContainer; import org.springframework.stereotype.Component; import java.nio.charset.StandardCharsets; /** * Author: Neco * Description: * Date: create in 2022/9/21 11:05 */ Component public class RedisTask extends KeyExpirationEventMessageListener { public RedisTask(RedisMessageListenerContainer listenerContainer) { super(listenerContainer); } Override public void onMessage(Message message, byte[] pattern) { // 接收到事件后回调 String channel new String(message.getChannel(), StandardCharsets.UTF_8); String key new String(message.getBody(), StandardCharsets.UTF_8); System.out.println(key: key , channel: channel); } }发布 RedisPublisherpackage cn.lazyfennec.redisdemo.publisher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Random; import java.util.concurrent.TimeUnit; /** * Author: Neco * Description: * Date: create in 2022/9/21 16:34 */ Component public class RedisPublisher { Autowired RedisTemplateString, Object redisTemplate; // 发布 public void publish(String key) { redisTemplate.opsForValue().set(key, new Random().nextInt(200), 10, TimeUnit.SECONDS); } // 循环指定时间触发 Scheduled(cron 0/15 * * * * ?) public void scheduledPublish() { System.out.println(scheduledPublish); redisTemplate.opsForValue().set(str1, new Random().nextInt(200), 10, TimeUnit.SECONDS); } }要实现Scheduled需要在启动类上加上注解SpringBootApplication EnableScheduling // 要加上这个用以启动 public class RedisdemoApplication {修改TestControllerpackage cn.lazyfennec.redisdemo.controller; import cn.lazyfennec.redisdemo.publisher.RedisPublisher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** * Author: Neco * Description: * Date: create in 2022/9/21 16:32 */ RestController public class TestController { Autowired RedisPublisher redisPublisher; GetMapping(/redis/{key}) public String publishEvent(PathVariable String key) { // 发布事件 redisPublisher.publish(key); return OK; } }如果觉得有收获欢迎点赞和评论更多知识请点击关注查看我的主页信息哦~AI大模型学习福利作为一名热心肠的互联网老兵我决定把宝贵的AI知识分享给大家。 至于能学习到多少就看你的学习毅力和能力了 。我已将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。一、全套AGI大模型学习路线AI大模型时代的学习之旅从基础到前沿掌握人工智能的核心技能因篇幅有限仅展示部分资料需要点击文章最下方名片即可前往获取二、640套AI大模型报告合集这套包含640份报告的合集涵盖了AI大模型的理论研究、技术实现、行业应用等多个方面。无论您是科研人员、工程师还是对AI大模型感兴趣的爱好者这套报告合集都将为您提供宝贵的信息和启示。因篇幅有限仅展示部分资料需要点击文章最下方名片即可前往获三、AI大模型经典PDF籍随着人工智能技术的飞速发展AI大模型已经成为了当今科技领域的一大热点。这些大型预训练模型如GPT-3、BERT、XLNet等以其强大的语言理解和生成能力正在改变我们对人工智能的认识。 那以下这些PDF籍就是非常不错的学习资源。因篇幅有限仅展示部分资料需要点击文章最下方名片即可前往获四、AI大模型商业化落地方案因篇幅有限仅展示部分资料需要点击文章最下方名片即可前往获作为普通人入局大模型时代需要持续学习和实践不断提高自己的技能和认知水平同时也需要有责任感和伦理意识为人工智能的健康发展贡献力量
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

茶叶有什么网站可以做推广网站域名备案 更改吗

想在自家商城开通转账支付渠道(即常用的B2B/B2C支付),核心是对接支付通道服务商,完成3步核心操作即可落地。首先,商户需对接正规支付通道服务商,申请开通专属收款账户(又称存款账户)…

张小明 2026/3/5 3:26:50 网站建设

做网站推广挣多少钱网站建设在哪能看

——致中国AI图片生成之路 今有西洋诸国,AI技术日新月异,图片生成之术,已臻化境。而我中华少年,欲一睹其妙,必翻山越壁,注册繁琐,费用高昂,望而却步者众矣! 呜呼&#xf…

张小明 2026/3/5 3:19:07 网站建设

北京网站建设成都公司wordpress front-page.php

还在为Windows家庭版无法实现多用户远程连接而烦恼吗?今天我们就来彻底解决这个痛点!RDP Wrapper作为一款轻量级工具,能让你的普通Windows系统瞬间拥有服务器级的远程桌面能力。准备好跟我一起探索这个实用工具了吗? 【免费下载链…

张小明 2026/3/5 3:19:07 网站建设

东南融通网站建设编写网站 支付宝

继续移动端项目框架搭建,购买的材料预计今天可以送货,到货后搭建一个demo进行测试,之后进行电路图绘制和3d建模做盒子造型。 项目概述 MagicBox 是一个基于 Flutter 开发的跨平台移动端应用,用于管理智能设备的发现、配置和控制…

张小明 2026/3/5 3:19:11 网站建设

河南建设银行网站西青做网站公司

Outlook Express使用指南:签名、收件箱管理与更多实用技巧 在当今数字化的时代,电子邮件已经成为我们日常沟通中不可或缺的一部分。Outlook Express作为一款经典的邮件客户端,提供了丰富的功能来帮助我们更高效地管理邮件。本文将详细介绍如何在Outlook Express中创建和使用…

张小明 2026/3/5 3:19:12 网站建设

外贸订单网站文章优化技巧

Wan2.2-T2V-5B 能生成影子吗?光照一致性深度评测 🌞📽️ 你有没有试过让 AI 生成一段“阳光斜照、人影移动”的视频? 结果却发现——影子一会儿在左,一会儿在右,甚至同一帧里树影和人影方向都不一致……&am…

张小明 2026/3/12 8:38:33 网站建设