customer:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.3.xsd">
<bean id="rabbitConnectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
<property name="username" value="${base-mq.username}" />
<property name="password" value="${base-mq.password}" />
<property name="addresses" value="${base-mq.addresses}" />
<property name="virtualHost" value="${base-mq.vhost}" />
</bean>
<rabbit:admin connection-factory="rabbitConnectionFactory" />
<rabbit:queue id="SPPARKINGVCQueue.NotifiCall" name="SPPARKINGVCQueue.NotifiCall" durable="true" auto-delete="false"/>
<!-- Rabbit MQ customer begin -->
<bean id="jsonConverterWithDefaultType" class="org.springframework.amqp.support.converter.Jackson2JsonMessageConverter">
<property name="classMapper">
<bean class="org.springframework.amqp.support.converter.DefaultClassMapper">
<property name="defaultType" value="com.zxq.iov.cloud.sp.parking.entity.TbPkInterVc"/>
</bean>
</property>
</bean>
<rabbit:listener-container connection-factory="rabbitConnectionFactory" concurrency="5" max-concurrency="10" message-converter="jsonConverterWithDefaultType">
<rabbit:listener ref="notificationServiceCallListener" method="listenInterfaceVc" queue-names="SPPARKINGVCQueue.NotifiCall" />
</rabbit:listener-container>
<bean id="notificationServiceCallListener" class="com.zxq.iov.cloud.sp.parking.mq.listener.NotificationServiceCallListener" />
</beans>
provider:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.3.xsd">
<bean id="rabbitConnectionFactory"
class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
<property name="username" value="${base-mq.username}" />
<property name="password" value="${base-mq.password}" />
<property name="addresses" value="${base-mq.addresses}" />
<property name="virtualHost" value="${base-mq.vhost}" />
</bean>
<rabbit:admin connection-factory="rabbitConnectionFactory" />
<bean id="jsonConverterWithDefaultType"
class="org.springframework.amqp.support.converter.Jackson2JsonMessageConverter">
<property name="classMapper">
<bean class="org.springframework.amqp.support.converter.DefaultClassMapper">
<property name="defaultType"
value="com.zxq.iov.cloud.sp.parking.entity.TbPkInterVc" />
</bean>
</property>
</bean>
<rabbit:queue id="SPPARKINGVCQueue.NotifiCall" name="SPPARKINGVCQueue.NotifiCall"
durable="true" auto-delete="false" />
<!-- exchange queue binging key 绑定 -->
<rabbit:direct-exchange id="PARKING_VC_MQ_exchange"
name="PARKING_VC_MQ_exchange" durable="true" auto-delete="false">
<rabbit:bindings>
<rabbit:binding queue="SPPARKINGVCQueue.NotifiCall"
key="SPPARKINGVCQueue.NotifiCall" />
</rabbit:bindings>
</rabbit:direct-exchange>
<!-- spring template声明 -->
<rabbit:template id="spParkingVcTemp" exchange="PARKING_VC_MQ_exchange"
connection-factory="rabbitConnectionFactory" message-converter="jsonConverterWithDefaultType" />
</beans>
分享到:
相关推荐
spring boot 集成rabbit mq 成功demo,spring boot 集成rabbit mq 成功demo
Rabbit MQ 是建立在强大的Erlang OTP平台上,因此安装Rabbit MQ的前提是安装Erlang
介绍Spring Cloud Stream与RabbitMQ集成的代码示例。Spring Cloud Stream是一个建立在Spring Boot和Spring Integration之上的框架,有助于创建事件驱动或消息驱动的微服务。
spring-boot-plus集成Spring Boot 2.1.6,Mybatis,Mybatis Plus,Druid,FastJson,Redis,Rabbit MQ,Kafka等,可使用代码生成器快速开发项目
十几个springboot的例子,包括集成Druid数据源,mybatis,rabbit MQ,redis,spring data JPA,spring Securiy 整车swagger文档等
RabbitMq的spring boot整合使用,测试成功,简单易懂哈
solr-rabbitmq-spring 该项目是 Rabbit MQ 和 Apache Solr 与 Spring-Data 的集成。 先决条件: 安装 RabbitMQ 3.4.4 : 这将安装 reLang 作为依赖为 Eclipse 安装 Jetty 插件将 Jetty 配置为在 8983 端口上运行并将...
规则引擎消息转发:支持KAFKA节点、HTTP节点、PREDICATE节点、ROCKET_MQ节点、RABBIT_MQ节点、MYSQL节点、MQTT节点、TOPIC节点、LOG节点 核心技术: 1、采用前后端分离的模式,前端框架VUE。 2、后端采用Spring Boot...
[Spring Boot:使用Rabbit MQ消息队列] [Spring Boot:整合JdbcTemplate] [Spring Boot:整合Spring Data JPA] [Spring Boot:整合MyBatis框架] [Spring Boot:实现MyBatis分页] [Spring Boot:集成Druid数据源] ...
本文详细介绍了如何在Spring Boot应用程序中集成并使用RabbitMQ作为消息传递中间件。通过结合RabbitMQ的特性与Spring Boot的便利性,我们将深入探讨如何实现可靠的消息传递、解耦服务和提高系统响应性能。文章首先...
java前公开源码 每个人都可以独立、快速...集成Rabbit/Rocket/Kafka MQ 集成 HikariCP 连接池,最终成为一个稳固的、高性能的 JDBC 连接池。 集成Spring Boot Admin,实时检测项目运行情况 集成 maven-assembly-plugin
Spring Boot示例代码 [Spring Boot中使用分布式应用限流实践] [Spring Boot中使用MongoDB增删改查] [Spring Boot中使用RocketMQ] [Spring Boot中使用Redis] [Spring Boot中使用RabbitMQ] [Spring Boot中使用...
springboot集成RabbitMQ非常简单,如果只是简单的使用配置非常少,springboot提供了spring-boot-starter-amqp项目对消息各种支持。下面通过本文给大家介绍下spring boot整合RabbitMQ(Direct模式),需要的朋友可以...
RabbitMq简介 安装 spring集成 集群的配置 等等
使用文档第一步: 添加依赖pom.xml中添加如下依赖<dependency> <groupId>com.uzdz.group</groupId> <artifactId>rabbit-mq</artifactId> <version>0.0.1-SNAPSHOT</version></dependency>第二步: 启动MQ组件在核心...
rabbitmq+spring+springmvc+mybatis+maven整合案例,欢迎大家下载使用