KB Article #181087
API Gateway embedded ActiveMQ HA implementation
Problem
- API Gateway embedded ActiveMQ high availability (HA) setup with a common shared message folder, is that the same as ActiveMQ "Shared file system master slave"?
- AciveMQ docs define several kinds of cluster setups, which one is used in API Gateway? link
- Is this a 'Network of brokers', a Master Slave setup, or Replicated Message Store?
- How to tell if a particular instance is the master broker or a slave broker?
- Two or more instances in a group with embedded Active MQ shared directory, how does it work?
Resolution
Our embedded JMS HA implementation is not quite the same as the common ActiveMQ cluster types. It is a network of brokers, using shared filesystem master slave. But, each instance in the group is always a Master broker, that also periodically starts a passive or slave broker that checks for available messages on the other instances.
Said another way: "API Gateway configures the embedded ActiveMQ instances as a static Networks of Brokers topology (each node using the Shared File System Master Slave HA feature in case another node goes down). A 'Master - Master' topology where a message only exists in one ActiveMQ server at a time, that server first tries to deliver the message to its local consumers, if it is not consumed, then a message is transferred (aka sent) to another master that has consumers for that queue name." "Messages transferred this way go from the head of the queue on the forwarding broker to the tail of the queue on the target. link"
As a result of this setup, our HA implementation:
- JMS messages added to any node can be consumed from any other node.
- JMS messages residing on a node that then goes offline will be accessible from other instances in that group.
- Our solution provides for message availability, but does not maintain message order. Ref: KB 181085.
- There may be a short delay while messages are transferred from one node to another. i.e. Adding one message to node A and then immediately trying to consume that message from node B may result in no messages found, until the message is moved to B.
- In order to support HA failover connections to alternate nodes, any external JMS clients must use ActiveMQ failover transport syntax. Ref KB 180587.