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

网站一年域名费用多少钱wordpress球形标签

网站一年域名费用多少钱,wordpress球形标签,网站做浮动边框asp代码,三亚西岛0、知识点 1、创建项目-生产者 默认官方start.spring.io已不支持自动生成低版本jkd的Spring项目,自定义用阿里云的starter即可:https://start.aliyun.com 2、创建配置类 package com.wym.rabbitmqprovider.utils;import org.springframework.amqp.core.…

0、知识点

1、创建项目-生产者

        默认官方start.spring.io已不支持自动生成低版本jkd的Spring项目,自定义用阿里云的starter即可:https://start.aliyun.com

2、创建配置类

package com.wym.rabbitmqprovider.utils;import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
public class DirectRabbitConfig {//队列 起名:TestDirectQueue@Beanpublic Queue TestDirectQueue() {// durable:是否持久化,默认是false,持久化队列:会被存储在磁盘上,当消息代理重启时仍然存在,暂存队列:当前连接有效// exclusive:默认也是false,只能被当前创建的连接使用,而且当连接关闭后队列即被删除。此参考优先级高于durable// autoDelete:是否自动删除,当没有生产者或者消费者使用此队列,该队列会自动删除。//   return new Queue("TestDirectQueue",true,true,false);//一般设置一下队列的持久化就好,其余两个就是默认falsereturn new Queue("TestDirectQueue",true);}//Direct交换机 起名:TestDirectExchange@BeanDirectExchange TestDirectExchange() {//  return new DirectExchange("TestDirectExchange",true,true);return new DirectExchange("TestDirectExchange",true,false);}//绑定  将队列和交换机绑定, 并设置用于匹配键:TestDirectRouting@BeanBinding bindingDirect() {return BindingBuilder.bind(TestDirectQueue()).to(TestDirectExchange()).with("TestDirectRouting");}@BeanDirectExchange lonelyDirectExchange() {return new DirectExchange("lonelyDirectExchange");}}

3、创建消息发送接口

package com.wym.rabbitmqprovider.controller;import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;@RestController
public class SendMessageController {@AutowiredRabbitTemplate rabbitTemplate;  //使用RabbitTemplate,这提供了接收/发送等等方法@GetMapping("/sendDirectMessage")public String sendDirectMessage() {String messageId = String.valueOf(UUID.randomUUID());String messageData = "test message, hello!";String createTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));Map<String,Object> map=new HashMap<>();map.put("messageId",messageId);map.put("messageData",messageData);map.put("createTime",createTime);//将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchangerabbitTemplate.convertAndSend("TestDirectExchange", "TestDirectRouting", map);return "ok";}
}

4、使用postapi测试

 5、查看客户端

 queues中也有了

 6、补充:导包、yml配置

 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-amqp</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
server:port: 8081
spring:#给项目来个名字application:name: rabbitmq-provider#配置rabbitMq 服务器rabbitmq:host: 127.0.0.1port: 5672username: guestpassword: guest#虚拟host 可以不设置,使用server默认host#-host: host

OK,接下来做消费者:Springboot集成RabbitMq二-CSDN博客

http://www.yayakq.cn/news/502485/

相关文章:

  • 网站建设简历模板浙江建设职业技术学院塘栖校区网站
  • 学生作业网站绍兴做外贸网站的公司
  • 光明建网站的公司睢宁建设局网站
  • 快团团小程序官网百度seo点击工具
  • 珠海seo网站建设广州优俊网站制作公司
  • 网站维护的内容主要包括深圳做购物网站
  • 双峰网站建设河南省建设厅官网查询
  • 网站搭建dns有用吗网页留言板模板
  • 英文网站建设步骤免费咨询法律援助该打什么电话
  • 主机网站建设工作纪律生活纪律研讨发言
  • 响应式网站建设服务提供商九江城市投资建设有限公司网站
  • 景德镇陶瓷企业网站建设网站建设都 包括哪些
  • 工程建设招投标网站网络服务提供者不履行法律、行政法规
  • 签订网站制作协议需注意什么app制作需要哪些技术
  • 移动门网站建设宁宁网seo
  • 单位做网站注意什么问题昆明抖音代运营公司
  • 教学类网站开发网页设计说明万能模板
  • 最简单的网站开发软件wordpress 2
  • 管理网站科技部
  • html5 企业网站wordpress 点击 排名
  • 网站建设痛点搜狗推广开户费多少钱
  • 淘客怎么做网站wordpress可以上传文件吗
  • 呼市做网站建设的公司哪家好攻击自己做的网站
  • 网站建设与管理 需求分析网站建设ahxkj
  • 如何做电影网站狼视听赣州信息港主页
  • 网站上传文件存储方式人网站建站
  • 本地网站源码cps推广
  • 天津品牌网站建设公司排名建设通app官网下载安装
  • 平面设计展示网站河南省建设工会网站
  • 室内设计网站免费素材移动端模板网站建设