Spring RabbitMq
spring-rabbitmq.xml文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/rabbit
http://www.springframework.org/schema/rabbit/spring-rabbit-1.2.xsd">
<!-- 连接服务配置 -->
<rabbit:connection-factory id="connectionFactory"
host="192.168.1.107" username="root" password="123456" port="5672" virtual-host="log_monitor_mq"/>
<!-- <rabbit:connection-factory id="connectionFactory"
host="192.168.0.200" username="root" password="123456" port="5672" virtual-host="log_monitor_mq"/>
-->
<rabbit:admin connection-factory="connectionFactory" />
<!-- queue 队列声明 -->
<rabbit:queue id="transfer_queue" durable="true" auto-delete="false"
exclusive="false" name="transfer_queue" />
<!-- exchange queue binging key 绑定 -->
<rabbit:direct-exchange name="monitor_exchange"
durable="true" auto-delete="false" id="monitor_exchange" auto-declare="true">
<rabbit:bindings>
<rabbit:binding queue="transfer_queue" key="transfer_queue_key" />
</rabbit:bindings>
</rabbit:direct-exchange>
<!-- spring amqp默认的是jackson
的一个插件,目的将生产者生产的数据转换为json存入消息队列,由于fastjson的速度快于jackson,这里替换为fastjson的一个实现
-->
<bean id="jsonMessageConverter" class="org.springframework.amqp.support.converter.JsonMessageConverter" />
<!-- spring template声明-->
<rabbit:template exchange="monitor_exchange" id="amqpTemplate"
connection-factory="connectionFactory" message-converter="jsonMessageConverter" />
</beans>
Spring RabbitMq的更多相关文章
- Spring Rabbitmq HelloWorld实例
之前的博客和大家分享了Rabbitmq的基本框架,及其工作原理,网址为 < http://www.cnblogs.com/jun-ma/p/4840869.html >.今天呢,想和大家一 ...
- Spring rabbitMq 中 correlationId或CorrelationIdString 消费者获取为null的问题
问题 在用Spring boot 的 spring-boot-starter-amqp 快速启动 rabbitMq 是遇到了个坑 消费者端获取不到:correlationId或Correlatio ...
- Spring RabbitMq概述
Spring AMQP consists of a handful of modules, each represented by a JAR in the distribution. These m ...
- spring rabbitmq集成
pom.xml加 <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-clien ...
- Spring RabbitMQ 延迟队列
一.说明 在实际业务场景中可能会用到延时消息发送,例如异步回调失败时的重发机制. RabbitMQ本身不具有延时消息队列的功能,但是可以通过rabbitmq-delayed-message-excha ...
- spring+rabbitmq+stomp搭建websocket消息推送(非spring boot方式)
前言: 两年前做过spring+activemq+stomp的ws推送,那个做起来很简单,但现在公司用的mq中间件是rabbitmq,因此需要通过rabbitmq去做ws通信.仔细搜了搜百度/谷歌,网 ...
- spring boot实战(第十二篇)整合RabbitMQ
前言 最近几篇文章将围绕消息中间件RabbitMQ展开,对于RabbitMQ基本概念这里不阐述,主要讲解RabbitMQ的基本用法.Java客户端API介绍.spring Boot与RabbitMQ整 ...
- spring boot / cloud (九) 使用rabbitmq消息中间件
spring boot / cloud (九) 使用rabbitmq消息中间件 前言 rabbitmq介绍: RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.它可以用于大型软件系统 ...
- Spring Boot(十三)RabbitMQ安装与集成
一.前言 RabbitMQ是一个开源的消息代理软件(面向消息的中间件),它的核心作用就是创建消息队列,异步接收和发送消息,MQ的全程是:Message Queue中文的意思是消息队列. 1.1 使用场 ...
随机推荐
- WooCommerce代码收集
修改首页和分类页面每页产品数量 每页显示多少产品默认跟随设置 » 阅读设置 » 博客页面至多显示的值,若要产品索引页和博文索引页使用不同的设置,可以使用下面的代码为产品索引页单独设置每页产品数. ad ...
- 邮件格式(HTML/TXT),TXT为文本邮件
<?phpclass smtp{/* Public Variables */var $smtp_port;var $time_out;var $host_name;var $log_file;v ...
- 对struct和class使用大括号初始化的测试
#include <iostream> using namespace std; struct struct1{ /* struct1(){ cout<<"this ...
- IOS第12天(2,UINavigationController导航控制器)
****HMAppDelegate.m @implementation HMAppDelegate - (BOOL)application:(UIApplication *)application d ...
- Color Space: HSI
HSI色彩空间是从人的视觉系统出发,用色调(Hue).色饱和度(Saturation或Chroma)和亮度 (Intensity或Brightness)来描述色彩.HSI色彩空间可以用一个圆锥空间模型 ...
- Thinking in Java——笔记(9)
Polymorphism Abstract classes and methods If you have an abstract class, objects of that specific cl ...
- HTML问题集锦及笔记
1.<html>和<body>之间的输出? 加入<p>or<script>均可正常运行 2.<br />换行,用<br>< ...
- 简单理解php的socket编程
php的socket编程算是比较难以理解的东西吧,不过,我们只要理解socket几个函数之间的关系,以及它们所扮演的角色,那么理解起来应该不是很难了,在笔者看来,socket编程,其实就是建立一个网络 ...
- leetcode 257
查找二叉树中根节点到叶子节点的所有路径: 本题有两种解法:递归解法和非递归解法,递归解法请参考:http://blog.csdn.net/booirror/article/details/477331 ...
- php组成数组
每次向数据库取5条数据,不足5条就不显示 $z = (int)(count($data) / 5);for ($ii = 1; $ii <= $z; $ii++) { foreach ($dat ...