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

淮北建投网站全球搜索网站排名

淮北建投网站,全球搜索网站排名,seo外包公司优化,什么是互联网企业说明#xff1a;本文章只是springboot和rabbitmq的直连整合#xff0c;只使用队列生产和消费消息#xff0c;最简单整合#xff01; 工程图#xff1a; A.总体pom.xml ?xml version1.0 encodingUTF-8?project xmlnshttp://…说明本文章只是springboot和rabbitmq的直连整合只使用队列生产和消费消息最简单整合 工程图 A.总体pom.xml ?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 http://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentartifactIdspring-boot-starter-parent/artifactId !-- 被继承的父项目的构件标识符 --groupIdorg.springframework.boot/groupId !-- 被继承的父项目的全球唯一标识符 --version2.2.2.RELEASE/version !-- 被继承的父项目的版本 --relativePath/ !-- lookup parent from repository --/parentgroupIdRabbitMqSpringbootDemo/groupIdartifactIdRabbitMqSpringbootDemo/artifactIdversion1.0-SNAPSHOT/versionpackagingpom/packagingmodulesmoduleMqCustomer/modulemoduleMqProducer/module/modulesnameRabbitMqSpringbootDemo Maven Webapp/name!-- FIXME change it to the projects website --urlhttp://www.example.com/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncodingmaven.compiler.source1.8/maven.compiler.sourcemaven.compiler.target1.8/maven.compiler.target/propertiesdependencies/dependenciesbuildfinalNameRabbitMqSpringbootDemo/finalNamepluginManagement!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --pluginspluginartifactIdmaven-clean-plugin/artifactIdversion3.1.0/version/plugin!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --pluginartifactIdmaven-resources-plugin/artifactIdversion3.0.2/version/pluginpluginartifactIdmaven-compiler-plugin/artifactIdversion3.8.0/version/pluginpluginartifactIdmaven-surefire-plugin/artifactIdversion2.22.1/version/pluginpluginartifactIdmaven-war-plugin/artifactIdversion3.2.2/version/pluginpluginartifactIdmaven-install-plugin/artifactIdversion2.5.2/version/pluginpluginartifactIdmaven-deploy-plugin/artifactIdversion2.8.2/version/plugin/plugins/pluginManagement/build /projectB.生产者MyProducer 1.pom.xml ?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 http://maven.apache.org/xsd/maven-4.0.0.xsdparentartifactIdRabbitMqSpringbootDemo/artifactIdgroupIdRabbitMqSpringbootDemo/groupIdversion1.0-SNAPSHOT/version/parentmodelVersion4.0.0/modelVersionartifactIdMqProducer/artifactIdpackagingjar/packagingnameMqProducer Maven Webapp/name!-- FIXME change it to the projects website --urlhttp://www.example.com/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncodingmaven.compiler.source1.8/maven.compiler.sourcemaven.compiler.target1.8/maven.compiler.target/propertiesdependencies!--spring boot核心--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependency!--spring boot 测试--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!--springmvc web--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!--开发环境调试--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-devtools/artifactIdoptionaltrue/optional/dependency!--amqp 支持--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependencydependencygroupIdcom.alibaba/groupIdartifactIdfastjson/artifactIdversion1.2.78/version/dependency!-- commons-lang3 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-lang3/artifactIdversion3.4/version/dependency!--lombok--dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdversion1.16.10/version/dependency/dependenciesbuildfinalNameMqProducer/finalNamepluginManagement!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --pluginspluginartifactIdmaven-clean-plugin/artifactIdversion3.1.0/version/plugin!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --pluginartifactIdmaven-resources-plugin/artifactIdversion3.0.2/version/pluginpluginartifactIdmaven-compiler-plugin/artifactIdversion3.8.0/version/pluginpluginartifactIdmaven-surefire-plugin/artifactIdversion2.22.1/version/pluginpluginartifactIdmaven-war-plugin/artifactIdversion3.2.2/version/pluginpluginartifactIdmaven-install-plugin/artifactIdversion2.5.2/version/pluginpluginartifactIdmaven-deploy-plugin/artifactIdversion2.8.2/version/plugin/plugins/pluginManagement/build /project2.application.yml server:port: 8080 spring:rabbitmq:port: 5672host: 192.168.18.145username: adminpassword: adminvirtual-host: / 3.AppP package com.dev;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;/*** 类名称** author lqw* date 2024年02月27日 14:20*/ SpringBootApplication public class AppP {public static void main(String[] args) {SpringApplication.run(AppP.class);} } 4.OnlyQueueRabbitConfig package com.dev.config;import org.springframework.amqp.core.Queue; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;/*** 类名称** author lqw* date 2024年02月28日 10:40*/ Configuration public class OnlyQueueRabbitConfig {/*** 队列* return onlyQueue队列名称 true 持久化*/Beanpublic Queue directOnlyQueue(){return new Queue(onlyQueue,true);}}5.OnlyQueueController package com.dev.controller;import lombok.extern.slf4j.Slf4j; 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.RequestMapping; import org.springframework.web.bind.annotation.RestController;/*** 类名称直接交换机 消息生产者** author lqw* date 2024年02月27日 14:47*/ Slf4j RestController RequestMapping(onlyQueue) public class OnlyQueueController {AutowiredRabbitTemplate rabbitTemplate; //使用RabbitTemplate,这提供了接收/发送等等方法/*** Direct测试* return*/GetMapping(/sendMessageByOnlyQueue)public String sendMessageByOnlyQueue() {rabbitTemplate.convertAndSend(, onlyQueue, 你好,Queue我是直连队列发送的消息);return ok;}} C.消费者MqCustomer 1.pom.xml ?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 http://maven.apache.org/xsd/maven-4.0.0.xsdparentartifactIdRabbitMqSpringbootDemo/artifactIdgroupIdRabbitMqSpringbootDemo/groupIdversion1.0-SNAPSHOT/version/parentmodelVersion4.0.0/modelVersionartifactIdMqCustomer/artifactIdpackagingjar/packagingnameMqCustomer Maven Webapp/name!-- FIXME change it to the projects website --urlhttp://www.example.com/urlpropertiesproject.build.sourceEncodingUTF-8/project.build.sourceEncodingmaven.compiler.source1.8/maven.compiler.sourcemaven.compiler.target1.8/maven.compiler.target/propertiesdependencies!--spring boot核心--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter/artifactId/dependency!--spring boot 测试--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!--springmvc web--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependency!--开发环境调试--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-devtools/artifactIdoptionaltrue/optional/dependency!--amqp 支持--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-amqp/artifactId/dependency!-- commons-lang3 --dependencygroupIdorg.apache.commons/groupIdartifactIdcommons-lang3/artifactIdversion3.4/version/dependency!--lombok--dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdversion1.16.10/version/dependency/dependenciesbuildfinalNameMqCustomer/finalNamepluginManagement!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --pluginspluginartifactIdmaven-clean-plugin/artifactIdversion3.1.0/version/plugin!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --pluginartifactIdmaven-resources-plugin/artifactIdversion3.0.2/version/pluginpluginartifactIdmaven-compiler-plugin/artifactIdversion3.8.0/version/pluginpluginartifactIdmaven-surefire-plugin/artifactIdversion2.22.1/version/pluginpluginartifactIdmaven-war-plugin/artifactIdversion3.2.2/version/pluginpluginartifactIdmaven-install-plugin/artifactIdversion2.5.2/version/pluginpluginartifactIdmaven-deploy-plugin/artifactIdversion2.8.2/version/plugin/plugins/pluginManagement/build /project2.application.yml server:port: 8081spring:rabbitmq:port: 5672host: 192.168.18.145username: adminpassword: admin3.AppC package cn.ct;import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;/*** 类名称** author lqw* date 2024年02月27日 14:20*/ SpringBootApplication public class AppC {public static void main(String[] args) {SpringApplication.run(AppC.class);} }4.OnlyQueueRabbitListener package cn.ct.listeners;import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component;/*** 类名称消息消费者* 直连* author lqw* date 2024年02月27日 14:58*/ Component public class OnlyQueueRabbitListener {RabbitListener(queues onlyQueue)RabbitHandlerpublic void process(String hello) {System.out.println(Rabbitmq : hello);}}总结这个是mq消息的最简单的使用只使用队列
http://www.tj-hxxt.cn/news/129967.html

相关文章:

  • 网站遭攻击广州网站快速优化排名
  • 网站模板大全 优帮云诚聘高新网站开发工程师
  • 仿网站视频教程衡水注册公司流程和费用
  • 贵港市城乡住房建设厅网站大连网站建设找简维科技
  • 网站建设网页设计用什么软件大连企业网站建设公司
  • 广州云建站模板驻马店百度seo
  • 网站建设厦门网页空间是什么意思
  • 自己做网站免费参考文献网站开发
  • 网站建设工作室+怎么样三亚市城乡建设局网站
  • 新网建站教程网站开发招投标书
  • 网站做短视频业务许可东莞市城建局
  • 网站建设成功案例方案wordpress项目展示设置
  • 潍坊网站制作发网站问卷调查系统怎么做
  • 网页版淘宝登录入口通化网站优化
  • 企业网站一般包括哪些内容网络营销推广方案策划与实施
  • 昆明网站建设天猫运营在线名片制作网站开发
  • 城市建设服务中心网站开发公司移交物业协议书
  • 昆明网站建设精英东莞百度seo哪家好
  • 代刷网站推广链接免费网站注册怎么做屏蔽过滤
  • 我国中小企业网站建设置顶 wordpress
  • 做网站 php asp.net jsp小学编程培训班多少钱一个月
  • 网站建设公司济南oa软件有哪些公司
  • 南昌外贸网站设计淘宝网站建设的策划书
  • 做设计应该看哪些网站亚马逊查关键词排名工具
  • 公司如何组建网站W7如何安装WordPress
  • 什么网站做生鲜比较好网站活动推广方案
  • 室外建筑网站重庆网站建设拓云
  • seo外链发布qq群排名优化软件
  • 网站镜像上传到域名空间电脑传奇游戏哪个好玩
  • dw自己做网站需要什么区别2017常用的网站