activeMq多个监听配置

阅读更多

activeMq多个监听配置:

集群或者zookeeper分布式集群分发处理只能到一个节点,即active的多个订阅端不会因此产生,除非一个系统配置了对个监听,监听一个发送通道(toptip)

在只有一个监听配置的时候,toptip就相当于queuen

配置多个监听客户端和配置一个一样只是clientId不同即可,当用的是下面的topic时有几个监听端就有会调用几次接收方法,(发送永远只发送一次)

当topic改为org.apache.activemq.command.ActiveMQQueue,(其他不需要动),不管有几个监听端,那个先消费就是谁,即只调用一次接受方法

 对于分布式系统,一般采用topic的方式,监听对应需要的发送者,不会出现同一个子系统,对同一个发送者的同一个队列监听两次(否则造成监听多次重复调用)

一个浏览器同一个系统只能登录一个账户,否则session会覆盖掉

 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:jms="http://www.springframework.org/schema/jms" xmlns:amq="http://activemq.apache.org/schema/core"

xmlns:aop="http://www.springframework.org/schema/aop"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd">

 

 

 

 

 

    

 

class="org.springframework.jms.listener.DefaultMessageListenerContainer">

///////////////////配置对个客户端的时候只要这个不同即可

class="org.springframework.jms.listener.DefaultMessageListenerContainer">

 

listenerContainer3"

class="org.springframework.jms.listener.DefaultMessageListenerContainer">

 

 

你可能感兴趣的:(activeMq多个监听配置)