Dashboard > 江南白衣博物馆 > ... > JMS > ActiveMQ Notes
  江南白衣博物馆 Log In | Sign Up   View a printable version of the current page.  
  ActiveMQ Notes
Added by Calvin, last edited by Calvin on 2008-12-19  (view change)
Labels: 
(None)

pure master/slave share nothing集群

1.1.1   服务端:

两台服务器(master-host,slave-host)分别作为master与slave。两台服务器间不共享任何后端存储(磁盘,数据库),客户端所有对master服务器的操作同步复制到slave服务器,当消息同步到slave后master才会向客户端返回结果。

master无需任何特别配置,slave需配置与master的连接:

<broker masterConnectorURI="tcp://masterhost:62001" shutdownOnMasterFailure="false">
.......

</broker> | 

1.1.2  客户端

客户端采用failover协议,连接URL为:| failover:(tcp://master | host:61616,tcp://slave | host:61616)?randomize=false | 客户端默认连接Master服务器,当Master服务器宕机时才连接slave服务器。

1.1.3   Master宕机与重启:

master宕机后,slave变成可连接状态,接替master工作.master如果需要重启,需要手工流程如下:

1.关闭slave服务器

2.将data目录从slave复制到master服务器

3.重启master与slave两台服务器。

其他特性

  • Message Groups 一组消息根据group id 交给同一个消费者,比如对同一张订单的增删改操作。
  • JMS Selectors用于在订阅中,基于消息属性对进行消息的过滤。JMS Selectors由SQL92语法定义。以下是个Selectors的例子:
    consumer = session.createConsumer(destination, "JMSType = 'car' AND weight > 2500");  
  • Composite Destinations:虚拟目标,实际发送到多个的queue或topic
    <destinationInterceptors>
        <virtualDestinationInterceptor>
        <virtualDestinations>
          <compositeQueue&nbsp;name="MY.QUEUE">
            <forwardTo>
              <filteredD estination&nbsp;selector="odd = 'yes'" queue="FOO"/>
              <filteredDestination&nbsp;selector="i = 5" topic="BAR"/>
            </forwardTo>
          </compositeQueue>
    </virtualDestinations>
    </virtualDestinationInterceptor>
    </destinationInterceptors>
  • Mirrored Queues:将queue复制一道,给监控程序收听
  • Wildcards:按通配符订阅 如有两个topic, PRICE.STOCK.NASDAQ.IBM (IBM在NASDAQ的股价) 和 PRICE.STOCK.NYSE.SUNW,可订阅PRICE.STOCK.> ,PRICE.STOCK.*.IBM
  •  

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 2006-09-07) - Bug/feature request - Contact Administrators
Get SpringSide at SourceForge.net. Fast, secure and Free Open Source software downloads