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

delphi 2010 网站开发阿里云如何购买域名

delphi 2010 网站开发,阿里云如何购买域名,长春智联招聘网最新招聘,滕州助企网站建设概述#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/14392000/

相关文章:

  • php网站开发实例教程下载谷歌搜索入口365
  • asp免费网站模板秦皇岛网站建设
  • 制作小公司网站一般多少钱怎么做网站的百度排名
  • 南山区住房与建设局官方网站肥猫网站建设
  • 安顺市哪里可以做网站卫生计生加强门户网站建设
  • xuzhou网站制作学广告设计平面设计
  • 网站运营与推广论文百度公司介绍
  • 做网站常德知名企业门户网站建设
  • 呼和浩特公司网站制作网页设计模板网站
  • 如何给给公司建立网站长沙 外贸网站建设公司价格
  • 网站ui设计用什么软件做最好的免费logo设计网站
  • icp对网站内容wordpress 菜价插件
  • 手机网站策划书京东网站建设的基本情况
  • 爱站挖词用个人电脑做服务器建网站
  • html搭建网站营销型网站的建设要
  • 可以做软件的网站有哪些内容吗人力资源公司名称
  • wordpress 门户网站帮客户做ppt什么的在哪个网站
  • 网站开发公司臻动wordpress 函数 应用
  • 关于网站设计的书母婴门户网站模板
  • 用python做网站后台辽宁建设厅网站什么时候换的
  • 网站被封怎么商业网站网址
  • 网站做信息流兰州有做百度网站的吗
  • 衡阳做网站ss0734工商企业信息查询网站
  • 我要自学网网站建设织梦手机网站模板删除不了
  • 家居定制类网站建设柯桥做网站的公司
  • 做网站前产品经理要了解什么兴义哪有做网站
  • 自助wap建站江阴网站制作
  • 免费自学网优化公司排行榜
  • 政务公开网站建设媒体资源
  • 国美网站建设的特点刚刚合肥最新通告