Problem: cluster on JMS queue or EHCache to solve the pending activity tracking problem.
There are several cluster modes for ActiveMQ JMS.
Cluster Mode
1.Queue consumer clusters
If a consumer dies, any unacknowledged messages are redelivered to other consumers on the queue.
If one consumer is faster than the others it gets more messages etc. If any consumer slows down, other consumers pick up the slack.
So you can have a reliable load balanced cluster of consumers on a queue processing messages.
Solve problems:
It provides a good grid style processing model for consuming messages.
It doesn't help us to solve our problem.
2.Broker clusters
The most common mental model of clustering in a JMS context is that there is a collection of JMS brokers and a JMS client will connect to one of them,
then if the JMS broker goes down, it will auto-reconnect to another broker.
Solve problems:
It provides load-balance and fail-over mechanism.
But each broker has its own queue instance, so the queue is not really cluster.
It doesn't help us to solve our problem.
3.Master Slave
The idea behind MasterSlave is that messaages are replicated to a slave broker so that even if you have catastrophic hardware failure of the master's machine,
file system or data centre, you get immediate failover to the slave with no message loss.
There has 3 types of master-slave mode:
-------------------------------------
Mode: Pure Master Slave
Pros: No central point of failure.
Cons: Requires manual restart to bring back a failed master and can only support 1 slave.
-------------------------------------
Mode: Shared File System Master Slave
Pros: Run as many slaves as required. Automatic recovery of old masters.
Cons: Requires shared file system.
-------------------------------------
Mode: JDBC Master Slave
Pros: Run as many slaves as required. Automatic recovery of old masters.
Cons: Requires a shared database. Also relatively slow as it cannot use the high performance journal.
-------------------------------------
Solve problems:
If we want to have a fail-over solution, it is the solution.
And it only supports fail-over instead of load-balance.
But we still have the "non-shared cache" in the master and slave JMS webapp instances.
4.Replicated Message Stores
An alternative to MasterSlave is to have some way to replicate the message store.
It doesn't help us to solve the problem.
Conclusion
If we want to have a fail-over solution,
then 2 production applications will share the same JMS webapp instance using the "Master-Slave" mode.
It supports the fail-over mechanism instead of load-balance.
But if we don't care about the fail-over mechanism, we can just run 2 JMS webapp instances in production.
Since JMS doesn't support the really queue based cluster as we described before,
so we have to do the cluster based on the EHCache.
Reference
http://activemq.apache.org/clustering.html
http://activemq.apache.org/masterslave.html
分享到:
相关推荐
在Windows系统上搭建ActiveMQ集群是一项关键的任务,它涉及到分布式消息传递系统的设计和优化。ActiveMQ是Apache软件基金会开发的一款开源消息代理,它遵循Java Message Service (JMS) 规范,提供高可靠的消息传递...
本篇文章将深入探讨两个主流的消息队列服务——RabbitMQ和ActiveMQ,特别是它们在集群环境下的部署和配置。 首先,我们来看RabbitMQ集群。RabbitMQ是一款基于AMQP协议的开源消息中间件,由Erlang编程语言实现,以其...
ZooKeeper在ActiveMQ中的主要作用是作为集群的选主仲裁器,确保在多台服务器组成的ActiveMQ集群中,只有一个Master节点对外提供服务,从而保证消息的有序性。 LevelDB是Google开源的一个轻量级、高性能、单机键值对...
ActiveMQ集群解析,详细讲解了详细中间件原理以及使用方法,非常基础的视频!!!
ActiveMQ集群的使用与配置 ActiveMQ集群支持多种不同的方面,包括Queue consumer clusters、Broker clusters和Network of brokers等。 Queue Consumer Clusters ActiveMQ支持订阅同一个queue的consumers上的集群...
ActiveMQ集群的配置和使用是软件开发中涉及消息中间件管理的重要部分,特别是在构建高可用性和可扩展性系统时。ActiveMQ作为一个强大的开源消息代理,提供了多种集群解决方案以确保服务的连续性和性能优化。 首先,...
ActiveMQ集群是为了解决大规模消息处理和提升系统高可用性而设计的一种部署模式。它允许通过连接多个独立的Broker实例,将它们作为一个整体对外提供服务,从而增强消息处理能力。这种模式使得集群中的各个Broker能够...
### ActiveMQ 集群 #### 1. ActiveMQ 简介 - **定义**:ActiveMQ 是一个开源的消息中间件,它支持多种消息传递模式,如点对点 (PTP) 和发布/订阅 (Pub/Sub)。 - **特点**: - 支持多种协议,如 AMQP、STOMP、MQTT ...
### ActiveMQ集群安装与部署详解 #### 一、概述 ActiveMQ是一款开源的消息中间件,支持多种消息协议,包括AMQP、STOMP等,并且具备丰富的特性如持久化消息存储、事务支持等。在分布式系统中,为了提高系统的可用性...
ActiveMQ集群实战教程
### ActiveMQ 集群配置详解 #### 一、引言 随着业务需求的增长和技术的发展,消息中间件作为系统架构中的重要组成部分,在保障系统稳定性和提高应用性能方面扮演着关键角色。ActiveMQ 作为一种高性能的消息中间件...
ActiveMq集群部署手册ActiveMq集群部署手册ActiveMq集群部署手册
这是介绍关于activemq 集群方面的资料,主要是理论性的资料
### ActiveMQ集群配置详解 #### 一、ActiveMQ与JMS规范基础 在深入了解ActiveMQ集群配置之前,我们首先简要回顾一下Java消息服务(Java Message Service, JMS)的基础概念,这对于理解ActiveMQ的工作原理及其集群...
activemq集群配置文档 基于Zookeeper和ActiveMQ的集群配置文档旨在实现高可用的消息队列系统。该文档将详细介绍如何使用Zookeeper实现Master-Slave模式来实现高可用性,并提供具体的部署方案和配置步骤。 一、 ...
Linux 环境下 ActiveMQ 持久化、集群环境搭建详解 在 Linux 环境下搭建 ActiveMQ 持久化和集群环境是一种复杂的任务,需要对 Linux 操作系统、Java 环境、ActiveMQ 等方面有深入的了解。以下是搭建 ActiveMQ 持久化...
ActiveMQ 集群网络连接模式(Network Connector)详解 ActiveMQ 集群网络连接模式(Network Connector)是 ActiveMQ 提供的一种集群功能,旨在提高消息服务的横向扩展性和高可用性。通过将多个不同的 broker 实例...