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

百度做网站的联系人大数据营销策略有哪些

百度做网站的联系人,大数据营销策略有哪些,企业服务账号是什么,科技公司网站首页概述#xff1a;安装看我上篇文章Docker安装rabbitmq-CSDN博客 任务一 创建一个队列 这样创建两个队列 在amq.fanout交换机里面发送数据 模拟发送数据 发送消息#xff0c;发现一下信息#xff1a; 所以得出理论#xff0c;消息发送是先到交换机#xff0c;然后由交换机…概述安装看我上篇文章Docker安装rabbitmq-CSDN博客 任务一 创建一个队列 这样创建两个队列 在amq.fanout交换机里面发送数据 模拟发送数据 发送消息发现一下信息 所以得出理论消息发送是先到交换机然后由交换机路由到消息队列 交换机是负责路由和转发消息的并没有存储的功能。 绑定队列 同理绑定queue2 这时再在交换机中发消息 查看结果 数据隔离 在rabbitmq中有虚拟主机的概念。 第一步新添用户 添加成功后发现没有虚拟主机也就是说我用这个用户登录后是不可以操作上面的数据的。 又因为我是超级管理员所以我能看到这些 所以只能看不能操作。 第二步创立自己的虚拟主机 第三步选自己的虚拟主机 选好后就只能看自己的了。 用Java代码操作 官网RabbitMQ Tutorials — RabbitMQ 可以看到官网上有案例我们大多情况下用的是SpringAmqp所以也就不讲那么多java简单调用的事情了。 用Spring AMQP操作 第一步在控制台里面创建一个simple.queue队列 第二步编写代码 pom文件 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersiongroupIdorg.cyl/groupIdartifactIdtest09/artifactIdversion0.0.1-SNAPSHOT/versionnametest09/namedescriptiontest09/descriptionpropertiesjava.version1.8/java.versionproject.build.sourceEncodingUTF-8/project.build.sourceEncodingproject.reporting.outputEncodingUTF-8/project.reporting.outputEncodingspring-boot.version2.6.13/spring-boot.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependencydependencygroupIdcom.rabbitmq/groupIdartifactIdamqp-client/artifactIdversion5.13.0/version/dependency/dependenciesdependencyManagementdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-dependencies/artifactIdversion${spring-boot.version}/versiontypepom/typescopeimport/scope/dependency/dependencies/dependencyManagementbuildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.8.1/versionconfigurationsource1.8/sourcetarget1.8/targetencodingUTF-8/encoding/configuration/pluginplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdversion${spring-boot.version}/versionconfigurationmainClassorg.cyl.test09.Test09Application/mainClassskiptrue/skip/configurationexecutionsexecutionidrepackage/idgoalsgoalrepackage/goal/goals/execution/executions/plugin/plugins/build/project配置mq服务端消息 spring:rabbitmq:host: 192.168.56.10port: 5672virtual-host: /cmallusername: cmallpassword: 123456 发送方 package org.cyl.test09.demos;import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;Service public class SendMessageService {Autowiredprivate RabbitTemplate rabbitTemplate;public void testSimpleQueue(){String queueNamesimple.queue;String messagehello,spring amqp!;rabbitTemplate.convertAndSend(queueName,message);}public void sendMessage(String exchange, String routingKey, Object message) {rabbitTemplate.convertAndSend(exchange, routingKey, message);} }接收方 package org.cyl.test09.demos;import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Service;Service public class ReceiveMessageService {RabbitListener(queues simple.queue)public void receiveMessage(String message) {System.out.println(接收到的消息 message);} }controller类 package org.cyl.test09.demos.controller;import org.cyl.test09.demos.ReceiveMessageService; import org.cyl.test09.demos.SendMessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController;RestController public class HelloController {AutowiredSendMessageService sendMsgservice;AutowiredReceiveMessageService receiveMsgService;GetMapping(/send)public String send(){sendMsgservice.testSimpleQueue();return ok;}}展示结果 Work模型 第一步创建一个队列 第二步编写代码 发送 package org.cyl.test09.demos;import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;Service public class SendMessageService {Autowiredprivate RabbitTemplate rabbitTemplate;public void testSimpleQueue() throws InterruptedException {String queueNamework.queue;for (int i1;i50;i){String messagehello,spring amqp!_i;rabbitTemplate.convertAndSend(queueName,message);Thread.sleep(20);}}public void sendMessage(String exchange, String routingKey, Object message) {rabbitTemplate.convertAndSend(exchange, routingKey, message);} }接收 package org.cyl.test09.demos;import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Service;Service public class ReceiveMessageService {RabbitListener(queues work.queue)public void receiveMessage1(String message) {System.out.println(消费者1接收到的消息 message);}RabbitListener(queues work.queue)public void receiveMessage2(String message) {System.out.println(消费者2接收到的消息 message);} }结果展示 消费者一和消费者二是轮询效果。 Fanout交换机 第一步创建队列 第二步创建交换机并绑定 第三步编写代码 发送端 public void testFanout() {String exchangeNamecmall.fanout;String messagehello,spring everyone;rabbitTemplate.convertAndSend(exchangeName,null,message);} 接收端 RabbitListener(queues fanout.queue1)public void receiveMessage3(String message) {System.out.println(消费者1接收到的消息 message);}RabbitListener(queues fanout.queue2)public void receiveMessage4(String message) {System.out.println(消费者2接收到的消息 message);} 展示结果 私发给不同的人Direct交换机 第一步创建两个队列 第二步声明交换机并绑定 第三步编写代码 接收方 RabbitListener(queues direct.queue1)public void receiveMessage5(String message) {System.out.println(消费者1接收到的消息 message);}RabbitListener(queues direct.queue2)public void receiveMessage6(String message) {System.out.println(消费者2接收到的消息 message);} 发送方 public void testDirect1() {String exchangeNamecmall.fanout;String messagehello,spring everyone;rabbitTemplate.convertAndSend(exchangeName,red,message);}public void testDirect2() {String exchangeNamecmall.fanout;String messagehello,spring blue;rabbitTemplate.convertAndSend(exchangeName,blue,message);}public void testDirect3() {String exchangeNamecmall.fanout;String messagehello,spring yellow;rabbitTemplate.convertAndSend(exchangeName,yellow,message);} Topic交换机 这个示例代码就懒得写了。 声明交换机和队列1 绑定队列到哪个交换机里面。 一般建立关系都是在消费者这边的。 声明交换机和队列2 基于注解式声明队列和交换机。 消息转换器 字节码可变会有安全问题。 搞完以上东西代码不用变在发一次即可为json。 好了基础讲完。
http://www.hkea.cn/news/14290688/

相关文章:

  • 事务所网站制作方案作文网站哪个平台好
  • 手机网站微信分享代码辽宁省城乡和住房建设厅网站
  • 电商平台正在建设中网站页面提示北京的电商平台网站有哪些
  • 厦门找一家做网站的公司深圳市住房与建设局网站
  • 城乡住房建设厅网站首页挖矿网站开发
  • 中能建设集团电子商务网站网站session
  • 阿里巴巴与慧聪网网站建设对比给艺术家做网站的工作
  • 古风网站建设wordpress 黑色
  • show-useragent wordpress 不显示广州百度seo 网站推广
  • 做和别人类似的网站侵权吗wordpress多个页面主题
  • 北海教网站建设一个人做网站好做吗
  • 哈尔滨网站建设市场广州网站设计廊坊公司电话
  • 重庆网站seo建设哪家好wordpress 网店插件
  • 学仿网站衡水的网站建设
  • 网站后台初始密码表单插件wordpress
  • 企业网站建设818gx深圳建设信息网站官网
  • 网站推广方式措施精选赣州网站建设
  • 网络营销类网站织梦 大型综合旅游网站 源码
  • 深圳网站开发专业东营网站建设tt0546
  • 网站建设基础培训南宁百度 - 网站正在建设中
  • 个人博客网站制作图片做外贸推广自己网站
  • 网站建设 微信小程序抖音小程序怎么添加
  • 展示中心网站建设如何电脑安装wordpress
  • 福建省建设人才与科技发展中心网站首页网站icp备案信息
  • html5怎么做简单的网站旅游网站建设风格
  • 做微信公众号的网站网站开发费用科目
  • 深圳建设管理中心网站七冶建设集团网站
  • 网站建设需求书电子网站建设设计
  • 怎么建一个卖东西的网站营销型企业网站有哪些
  • 网络维护工程师工资多少企业优化网站