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. Python数据类型(3)

    字符串(str):单引号''.双引号""嵌套使用,可以不使用转义字符:'abc"dd"ef'."acc'd'12",字符串不可以是多行的三单 ...

  2. poj3292-Semi-prime H-numbers(筛法打表)

    一,题意:  一个H-number是所有的模四余一的数.(x=4*k+1)  如果一个H-number是H-primes 当且仅当它的因数只有1和它本身(除1外). 一个H-number是H-semi ...

  3. ubuntu下wine安装软件

    安装wine 1. sudo apt-get install playonlinux playonlinux就是wine.或者在软件中心,搜索wine. 2. 在dash搜索playonlinux 安 ...

  4. EL表达式与JSTL

    内容包括 EL表达式 EL函数库 JSTL 核心标签库 格式化标签库 SQL标签库 XML标签库 自定义标签库 EL表达式 EL是Expression Language的是缩写,是JSP页面编写的一种 ...

  5. Docker Compose—简化复杂容器应用的利器

    Compose是用于定义和运行复杂Docker应用的工具.你可以在一个文件中定义一个多容器的应用,然后使用一条命令来启动你的应用,然后所有相关的操作都会被自动完成. 1. 安装Docker和Compo ...

  6. javac编译、运行

    java源码(包结构) 源码存放位置:C:/Users/liaolongjun/DeskTop/java/ package test; import test.sub.F; public class ...

  7. MVC控制器取参数值

    1.这个方法是获取提交表单里的参数值,也就是有name="xxx"的属性的表单控件的值 FormCollection传值 public ActionResult Login(For ...

  8. pycharm 单元测试失败 not found while handling absolute import

    pycharm 单元测试运行错误 RuntimeWarning: Parent module 'tests' not found while handling absolute import impo ...

  9. Log4j学习

    学习链接: http://www.codeceo.com/article/log4j-usage.html http://www.blogjava.net/kit-soft/archive/2009/ ...

  10. MVC过滤器详解 面向切面编程(AOP)

    面向切面编程:Aspect Oriented Programming(AOP),面向切面编程,是一个比较热门的话题.AOP主要实现的目的是针对业务处理过程中的切面进行提取,它所面对的是处理过程中的某个 ...