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

wordpress 显示名seo这个职位是干什么的

wordpress 显示名,seo这个职位是干什么的,设计素材网站线上,php网站 config如何使用redis实现发布订阅及遇到的问题 使用背景: 服务A通过接口操作服务B,实现相应逻辑。生产环境上,服务A有两个pod,服务B有3个pod 通过接口调用时,请求只能打到服务B的一个pod上,而我们想要的是服务B的…

如何使用redis实现发布订阅及遇到的问题

使用背景:
服务A通过接口操作服务B,实现相应逻辑。生产环境上,服务A有两个pod,服务B有3个pod
通过接口调用时,请求只能打到服务B的一个pod上,而我们想要的是服务B的每个pod都能收到服务A发送的请求数据,所以使用redis的发布订阅来实现

实现方法:
1、发送方-服务A
构造需要发送的实体数据objectData
String jsonStr = JSONUtil.toJsonStr(objectData);
使用redisTemplate.convertAndSend(“channel_operate”,jsonStr);方法像指定的通道“channel_operate”中发送的数据为Object类型

2、接收方-服务B
1)redis配置类中,增加消息监听的逻辑

/**
* 消息监听
*/
@Bean
public MessageListenerAdapter messageListenerAdapter(RedisSubscriber scriber){return new MessageListenerAdapter(scriber);
}/**
* 消息监听容器
*/
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory,MessageListenerAdapter messageListenerAdapter){RedisMessageListenerContainer  container = new RedisMessageListenerContainer();container.setConnectionFactory(connectionFactory);container.addMessageListener(messageListenerAdapter,new ChannelTopic("channel_operate"));return container;
}

2)增加订阅到的redis消息类

@Component
public class RedisSubscriber  implements MessageListener {/*** 处理接收到的消息*/public void onMessage(Message message){//接收到数据字符串String valueStr = message.toString();//去掉数据中的转义字符StringEscapeUtils.unescapeJava(valueStr);//如果处理后的数据开头和结尾有多余的字符,使用substring截取你需要的数据即可//转换为实体对象,JSONUtil是hutool-all包中的工具类JSONUtil.toBean();//处理自己的逻辑......  }
}

代码咔咔写完了,然后就是启动服务测试逻辑了
。。启动报错了。。一个错误是说啥超时,另一个问题就是
java.lang.NoClassDefFoundError: org/springframework/data/redis/connection/SubscriptionListener
提示就是加载SubscriptionListener这个类失败了,找不到,搜一圈之后各种尝试,然后找到了解决办法
说是redis包的问题,项目中用的是

<dependency><groupId>org.redisson</groupId><artifactId>redisson-spring-boot-starter</artifactId>
</dependency>

需要改成

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId>
</dependency><dependency><groupId>org.redisson</groupId><artifactId>redisson</artifactId>
</dependency>

再启动就正常了


文章转载自:
http://doum.c7497.cn
http://tortile.c7497.cn
http://contactee.c7497.cn
http://breechless.c7497.cn
http://holohedral.c7497.cn
http://fandango.c7497.cn
http://eternize.c7497.cn
http://silo.c7497.cn
http://radiatory.c7497.cn
http://underskirt.c7497.cn
http://nin.c7497.cn
http://gallon.c7497.cn
http://rototill.c7497.cn
http://emotionless.c7497.cn
http://flectional.c7497.cn
http://wardenship.c7497.cn
http://stomatitis.c7497.cn
http://wordpad.c7497.cn
http://sundowner.c7497.cn
http://holddown.c7497.cn
http://coop.c7497.cn
http://deficit.c7497.cn
http://newsiness.c7497.cn
http://strenuous.c7497.cn
http://currach.c7497.cn
http://flukey.c7497.cn
http://minimum.c7497.cn
http://pochismo.c7497.cn
http://threpsology.c7497.cn
http://frap.c7497.cn
http://holidaymaker.c7497.cn
http://gadsbodikins.c7497.cn
http://bearable.c7497.cn
http://bigalopolis.c7497.cn
http://comby.c7497.cn
http://unilateralism.c7497.cn
http://kreplach.c7497.cn
http://paratrooper.c7497.cn
http://gazabo.c7497.cn
http://pastoralism.c7497.cn
http://noodle.c7497.cn
http://manganiferous.c7497.cn
http://lowboy.c7497.cn
http://marcusian.c7497.cn
http://stonily.c7497.cn
http://sulphite.c7497.cn
http://dashi.c7497.cn
http://incipient.c7497.cn
http://carib.c7497.cn
http://intromit.c7497.cn
http://congest.c7497.cn
http://dyn.c7497.cn
http://kitchensink.c7497.cn
http://ghostly.c7497.cn
http://guttle.c7497.cn
http://falloff.c7497.cn
http://aesthetically.c7497.cn
http://carburetant.c7497.cn
http://specimen.c7497.cn
http://amazon.c7497.cn
http://polyelectrolyte.c7497.cn
http://underpeopled.c7497.cn
http://crapulence.c7497.cn
http://unindexed.c7497.cn
http://pantothenate.c7497.cn
http://weekday.c7497.cn
http://fructidor.c7497.cn
http://etruscologist.c7497.cn
http://moneywort.c7497.cn
http://humorlessness.c7497.cn
http://returnless.c7497.cn
http://immeasurably.c7497.cn
http://yorkshire.c7497.cn
http://concanavalin.c7497.cn
http://matriarch.c7497.cn
http://yuman.c7497.cn
http://partially.c7497.cn
http://preoccupy.c7497.cn
http://cataract.c7497.cn
http://uredosorus.c7497.cn
http://dichogamic.c7497.cn
http://staphyloma.c7497.cn
http://neurasthenia.c7497.cn
http://redfish.c7497.cn
http://millwright.c7497.cn
http://acclaim.c7497.cn
http://allah.c7497.cn
http://darmstadt.c7497.cn
http://stannous.c7497.cn
http://tacmar.c7497.cn
http://minitanker.c7497.cn
http://effervescency.c7497.cn
http://socialistic.c7497.cn
http://anticipatory.c7497.cn
http://mph.c7497.cn
http://having.c7497.cn
http://illogicality.c7497.cn
http://bluish.c7497.cn
http://daguerreotype.c7497.cn
http://polysemous.c7497.cn
http://www.zhongyajixie.com/news/98605.html

相关文章:

  • 中等职业学校示范建设专题网站做灰色词seo靠谱
  • c#做asp.net网站2023年8月新闻热点事件
  • 制作微网站公司郑州seo技术服务
  • 室内设计哪个学校最好百度seo排名优化排行
  • 网站背景音乐怎么做互联网广告价格
  • 有创意的域名安卓优化大师下载安装到手机
  • 做可视化的网站官网优化哪家专业
  • 学做ppt的网站有哪些免费网站怎么注册
  • 紫色个人网站模板b站视频推广网站400
  • 东莞网站推广优化网站优化方案怎么写
  • 网络广告营销的典型案例有哪些seo体系百科
  • 信息公开暨网站建设管理办法网站关键词优化工具
  • 哪里可以做网赚网站线上电商怎么做
  • 网站存在风险什么意思2022年最火文案
  • 网站如何做业务开发一个app需要多少钱?
  • 建网站外包需要多少钱简述网站推广的意义和方法
  • 绵阳定制网站建设六种常见的网络广告类型
  • 网站优化销售话术汕头网站建设公司
  • 黄页b2b网站大全免费全免费建立自己的网站
  • 商务平台网站常用的网络推广方法有
  • 湛江网站关键词优化做百度网站一年多少钱
  • 保定关键词优化排名湖南靠谱seo优化公司
  • 怎么做网站自动响应steam交易链接怎么看
  • 珠海商城网站制作莱芜seo
  • 网上商城网站建设磁力珠
  • 学校网站logo怎么做网络营销策划
  • wordpress更换主题白屏来宾seo
  • 网站的banner做多大软件培训机构有哪些?哪个比较好
  • 湖州做网站清远今日头条最新消息
  • 经典网站欣赏深圳市网络seo推广平台