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

浙江省电子商务网站建设沈阳百度seo排名优化软件

浙江省电子商务网站建设,沈阳百度seo排名优化软件,校园推广app,个人导航网站如何赚钱一、安装Erlang与Rabbitmq 安装教程本教程是在centos8下试验的,其实linux系统的都差不多RabbitMQ官方:Messaging that just works — RabbitMQRabbitMQ是开源AMQP实现,服务器端用Erlang语言编写,Python、Ruby、 NET、Java、JMS、c…

一、安装Erlang与Rabbitmq

 安装教程本教程是在centos8下试验的,其实linux系统的都差不多RabbitMQ官方:Messaging that just works — RabbitMQRabbitMQ是开源AMQP实现,服务器端用Erlang语言编写,Python、Ruby、 NET、Java、JMS、c、PHP、action screcrive AMQP (高级消息队列协议)和高级消息队列协议是APP应用层协议的开放标准,是为面向消息的中间件而设计的。消息中间件主要用于组件之间的解耦,其中消息的发送方不需要知道消息使用者的存在,反之_rabbitmq安装https://blog.csdn.net/weixin_44545251/article/details/128216395

二、在springboot中使用rabbitmq

1.导入依赖

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

2.编写配置文件

spring:rabbitmq:host: localhostport: 5672username: guestpassword: guest

3.配置一个队列

package com.example.Rabbtimq.config;import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
public class QueueAndExchangeConfig {@Bean("myFirstQueue")public Queue getFirstQueue(){return new Queue("my-first-queue");}
}

4.编写一个生产者类

package com.example.Rabbtimq.controller;import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("producer")
public class RabbitMqController {@Autowiredprivate RabbitTemplate rabbitTemplate;@GetMapping("producerSendFirstQueue")public String sendMsg(String msg){rabbitTemplate.convertAndSend("my-first-queue",msg);return msg;}}

5.编写一个消费者监听队列中的消息

package com.example.Rabbtimq.controller;import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@Component
public class ConsumerHandler {@RabbitListener(queues = "my-first-queue")public void getFirstQueue(String msg){System.out.println("消费者1:"+msg);}
}

6.使用接口工具调生产接口

7.查看图形化界面

http://www.hkea.cn/news/320713/

相关文章:

  • 常德网站开发百度推广登录首页网址
  • 网站建设软件设计推广官网
  • 网站运营阶段站长之家app
  • discuz网站标题百度广告推广价格
  • 广州学校论坛网站建设疫情排行榜最新消息
  • 古董手表网站网络营销的主要方式和技巧
  • 做公司网站要那些资料百度电脑版下载官方
  • 定州网站建设公司企业网站源码
  • 0基础1小时网站建设教程如何给自己的公司建网站
  • 成都网站建设s1emens电商平台怎么加入
  • 六合哪家做网站建设域名注册查询软件
  • 网站建设的方案费用2023年新冠疫情最新消息
  • 九星市场做网站快速将网站seo
  • 长春做网站推广的公司提升神马关键词排名报价
  • 金融网站cms百度网盘客服电话人工服务
  • 美观网站建设物美价廉seo网站优化专员
  • 网站设计应该怎么做推广软文代写
  • 网站建设工作室发展百度收录教程
  • 没有网站 可以做百度口碑吗成都网站制作
  • 医院系统网站建设百度宁波营销中心
  • 网站劫持代码杭州互联网公司排名榜
  • 做网站找哪个部门吸引人的推广标题
  • 网站制作软件名字线做竞价推广代运营公司
  • avada如何做中英文网站沈阳百度推广排名优化
  • 做网站品长沙网络营销公司排名
  • b2b商贸网站环球网最新消息疫情
  • wordpress next主题什么是seo教程
  • 如何规划一个网站快手秒赞秒评网站推广
  • 中国网站开发网站seo需要用到哪些工具
  • 织梦做的网站首页出现空白网页平台做个业务推广