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的更多相关文章

  1. Spring Rabbitmq HelloWorld实例

    之前的博客和大家分享了Rabbitmq的基本框架,及其工作原理,网址为 < http://www.cnblogs.com/jun-ma/p/4840869.html >.今天呢,想和大家一 ...

  2. Spring rabbitMq 中 correlationId或CorrelationIdString 消费者获取为null的问题

    问题 在用Spring boot 的 spring-boot-starter-amqp   快速启动 rabbitMq 是遇到了个坑 消费者端获取不到:correlationId或Correlatio ...

  3. Spring RabbitMq概述

    Spring AMQP consists of a handful of modules, each represented by a JAR in the distribution. These m ...

  4. spring rabbitmq集成

    pom.xml加 <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-clien ...

  5. Spring RabbitMQ 延迟队列

    一.说明 在实际业务场景中可能会用到延时消息发送,例如异步回调失败时的重发机制. RabbitMQ本身不具有延时消息队列的功能,但是可以通过rabbitmq-delayed-message-excha ...

  6. spring+rabbitmq+stomp搭建websocket消息推送(非spring boot方式)

    前言: 两年前做过spring+activemq+stomp的ws推送,那个做起来很简单,但现在公司用的mq中间件是rabbitmq,因此需要通过rabbitmq去做ws通信.仔细搜了搜百度/谷歌,网 ...

  7. spring boot实战(第十二篇)整合RabbitMQ

    前言 最近几篇文章将围绕消息中间件RabbitMQ展开,对于RabbitMQ基本概念这里不阐述,主要讲解RabbitMQ的基本用法.Java客户端API介绍.spring Boot与RabbitMQ整 ...

  8. spring boot / cloud (九) 使用rabbitmq消息中间件

    spring boot / cloud (九) 使用rabbitmq消息中间件 前言 rabbitmq介绍: RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.它可以用于大型软件系统 ...

  9. Spring Boot(十三)RabbitMQ安装与集成

    一.前言 RabbitMQ是一个开源的消息代理软件(面向消息的中间件),它的核心作用就是创建消息队列,异步接收和发送消息,MQ的全程是:Message Queue中文的意思是消息队列. 1.1 使用场 ...

随机推荐

  1. HTML-embed标签详解

    Embed(一).基本语法:embed src=url说明:embed可以用来插入各种多媒体,格式可以是 Midi.Wav.AIFF.AU.MP3等等,      Netscape及新版的IE 都支持 ...

  2. 使用engine关键字指定该表使用哪个engine

    建表及插入数据语句:mysql> create table salary(userid int,salary decimal(9,2));Query OK, 0 rows affected (0 ...

  3. DOM模型有三种

    <!-- DOM模型有三种: DOM level 1:将HTML文档封装成对象. DOM level 2:在level 1基础加入新功能,比如解析名称空间. //<html xmlns=& ...

  4. SSH相关

    [root@www ~]# vim /etc/ssh/sshd_config# 1. 关于SSH Server 的整体设定,包含使用的port 啦,以及使用的密码演算方式# Port 22# SSH ...

  5. Yii源码阅读笔记(二十三)

    Module类中的辅助功能方法: /** * Returns an ID that uniquely identifies this module among all modules within t ...

  6. MVC Pager 使用

    MVC Pager  4.0+     3.0版本使用  ,直接来点使用的.一看就明白 @Ajax.Pager(Model,pagerOptions,mvcAjaxOptions); @using W ...

  7. 与子域名共用session信息

    参考自 http://www.jb51.net/article/19664.htm 下面的步骤只使用于两个域名在同一个服务起得情况下,如果不在一个服务器上,就需要考虑通过数据库来存储session信息 ...

  8. [转]倍数提高工作效率的 Android Studio 奇技

    转自:http://android.jobbole.com/81687/ 倍数提高工作效率的 Android Studio 奇技 2015/10/08 · 技术分享 · 4 评论· Android S ...

  9. NGINX: 405 Not Allowed

    近期做一个手机端静态网站,在wcm上网站预览的时候显示正常,网站数据发布到nginx网站服务上后,发现页面有部分不显示: 正常页面: 错误页面: 进入谷歌浏览器的Developer Tools(F12 ...

  10. 白话学习MVC(六)模型绑定

    一.什么是模型绑定? 模型绑定存在的意义就是为Action的参数提供值,例如:如下表单中提交了数据,那么Action(即:Index)的参数Id,Name的值就是表单中对应的name属性相同的值,而表 ...