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

假网站怎么做公司网站网址注册和备案哪里找

假网站怎么做,公司网站网址注册和备案哪里找,能在线做实验的网站,免费网站搭建服务异步通讯——springcloud 文章目录 服务异步通讯——springcloud初始MQRabbitMQ快速入门单机部署1.1.下载镜像安装MQ SpringAMQPwork Queue 工作队列Fanout Exchange广播模式DirectExchange路由模式TopicExchange话题模式 消息转换器 初始MQ RabbitMQ快速入门 官网https:/…服务异步通讯——springcloud 文章目录 服务异步通讯——springcloud初始MQRabbitMQ快速入门单机部署1.1.下载镜像安装MQ SpringAMQPwork Queue 工作队列Fanout Exchange广播模式DirectExchange路由模式TopicExchange话题模式 消息转换器 初始MQ RabbitMQ快速入门 官网https://www.rabbitmq.com/ 单机部署 我们在Centos7虚拟机中使用Docker来安装。 1.1.下载镜像 方式一在线拉取 docker pull rabbitmq:3-management方式二从本地加载 在课前资料已经提供了镜像包 上传到虚拟机中后使用命令加载镜像即可 docker load -i mq.tar安装MQ 执行下面的命令来运行MQ容器 docker run \-e RABBITMQ_DEFAULT_USERitcast \-e RABBITMQ_DEFAULT_PASS123321 \--name mq \--hostname mq1 \-p 15672:15672 \-p 5672:5672 \-d \rabbitmq:3-managementSpringAMQP https://spring.io/projects/spring-amqp/ !--AMQP依赖包含RabbitMQ--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependencyspring:rabbitmq:host: 192.168.10.88 # rabbitMQ的ip地址port: 5672 # 端口username: itcastpassword: 123321virtual-host: /RunWith(SpringRunner.class) SpringBootTest public class SpringAmqpTest {Autowiredprivate RabbitTemplate rabbitTemplate;Testpublic void testSendMessage2SimpleQueue(){String queueName simple.queue;String message hello, spring amqp!;rabbitTemplate.convertAndSend(queueName,message);} } package cn.itcast.mq.listener;import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component;Component public class SpringRabbitListener {RabbitListener(queues simple.queue)public void listenSimpleQueue(String msg){System.out.println(消费者接受到消息[ msg ]);} } work Queue 工作队列 Fanout Exchange广播模式 Configuration public class FanoutConfig {// itcast.fanoutBeanpublic FanoutExchange fanoutExchange(){return new FanoutExchange(itcast.fanout);}// fanout.queue1Beanpublic Queue fanoutQueue1(){return new Queue(fanout.queue1);}// 绑定队列1到交换机Beanpublic Binding fanoutBinding1(Queue fanoutQueue1, FanoutExchange fanoutExchange){return BindingBuilder.bind(fanoutQueue1).to(fanoutExchange);}// fanout.queue2Beanpublic Queue fanoutQueue2(){return new Queue(fanout.queue2);}// 绑定队列2到交换机Beanpublic Binding fanoutBinding2(Queue fanoutQueue2, FanoutExchange fanoutExchange){return BindingBuilder.bind(fanoutQueue2).to(fanoutExchange);}} RabbitListener(queues fanout.queue1)public void listenFanoutQueue1(String msg){System.out.println(消费者接受到fanoutQueue1 消息[ msg ]);}RabbitListener(queues fanout.queue2)public void listenFanoutQueue2(String msg){System.out.println(消费者接受到fanoutQueue2 消息[ msg ]);} Testpublic void testSendFanoutExchange(){//交换机名称String exchanneName itcast.fanout;//消息String message hello every one!;// 发送消息rabbitTemplate.convertAndSend(exchanneName,,message);}DirectExchange路由模式 RabbitListener(bindings QueueBinding(value Queue(name direct.queue1),exchange Exchange(name itcast.direct,type ExchangeTypes.DIRECT),key {red,blue}))public void LinstenDirectQueue1(String msg){System.out.println(消费者接受到directQueue1 消息[ msg ]);}RabbitListener(bindings QueueBinding(value Queue(name direct.queue2),exchange Exchange(name itcast.direct,type ExchangeTypes.DIRECT),key {red,yellow}))public void LinstenDirectQueue2(String msg){System.out.println(消费者接受到directQueue2 消息[ msg ]);}Testpublic void testSendDirectExchange(){//交换机名称String exchanneName itcast.direct;//消息String message hello,red;// 发送消息rabbitTemplate.convertAndSend(exchanneName,red,message);}TopicExchange话题模式 RabbitListener(bindings QueueBinding(value Queue(name topic.queue1),exchange Exchange(name itcast.topic,type ExchangeTypes.TOPIC),key china.#))public void LinstenTopicQueue1(String msg){System.out.println(消费者接受到topicQueue1消息[ msg ]);}RabbitListener(bindings QueueBinding(value Queue(name topic.queue2),exchange Exchange(name itcast.topic,type ExchangeTypes.TOPIC),key #.news))public void LinstenTopicQueue2(String msg){System.out.println(消费者接受到topicQueue2消息[ msg ]);}Testpublic void testSendTopicExchange(){//交换机名称String exchanneName itcast.topic;//消息String message 小米汽车倒闭了;// 发送消息rabbitTemplate.convertAndSend(exchanneName,china.news,message);}消息转换器 Testpublic void testSendOnjectQueue() {MapString, Object msg new HashMap();msg.put(name,柳岩);msg.put(age,18);rabbitTemplate.convertAndSend(object.queue,msg);}dependencygroupIdcom.fasterxml.jackson.core/groupIdartifactIdjackson-databind/artifactId/dependencyBeanpublic MessageConverter messageConverter(){return new Jackson2JsonMessageConverter();}RabbitListener(queues object.queue)public void ListenObjectQueue(MapString,Object msg){System.out.println(接收到object.queue的消息 msg);}
http://www.zqtcl.cn/news/997310/

相关文章:

  • 北京南站在哪个区哪个街道html表白简单代码
  • 海口网站建设流程郑州三牛网站建设
  • 谁有国外hs网站沈阳关键字优化公司
  • wordpress双站企业品牌类网站
  • 网站架构软件做淘客app要网站吗
  • 云南云桥建设股份有限公司官方网站汽车seo是什么意思
  • 陕西省建设厅执业资格注册中心网站报名系统外贸网站 字体
  • 个人html网站百度一下生活更好
  • 做网站公司徐汇服务器 网站 搬家
  • 河北省和城乡建设厅网站首页单页设计图片
  • 海东地网站建设南京市建设局网站栖霞
  • 1g做网站空间a3网站建设
  • 海络网站室内设计工作前景
  • 柳州旅游网站建设橱柜设计师培训
  • 做网站属于什么专业个人是否可以申请网址
  • 品牌网站建是啥网站点击率怎么建
  • 上海市质量工程建设管理协会网站网站开发制作公司排行
  • 网站空间租用多少钱怎么在外贸公司拿订单
  • 建设银行网站背景图片温州做网站哪家比较好
  • 网站架设建设如何做网站电话
  • 团购网站怎么推广app平台搭建步骤
  • 沂水建设局网站郑州企业微网站建设
  • 免费企业网站空间wordpress目录主题
  • 做网站的销售话术苏州网站设计哪家公司好
  • 足球梦网站建设的基本思路网站介绍词
  • 森马网站建设情况网站推广中应注意哪些事项
  • 简单网站vs2008不能新建网站
  • 牌具做网站可以吗海外广告投放公司
  • 响应式单页网站模板宁波企业自助建站
  • 网站广告收费标准装饰设计公司起名