ActiveMQ Failover with Forum Sentry

Introduction

This article illustrates how Forum Sentry supports ActiveMQ Failover.  Special configuration on the ActiveMQ Server side, such as primary vs. secondary are not included. 

The Activemq.xml defines the TCP listener as shown below.  This is a simple setup where no other clustering information/parameters are used: 

<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>

The use case details below assume there are two ActiveMQ servers configured as indicated above.

 

Use Case Steps

The Sentry configuration objects detailed below are included in the attached v8.7 FSG (import password is password). After importing the FSG, update the listener and remote policies to point to your own ActiveMQ instances.

  1. ActiveMQ listener where the connection URI is set to the two ActiveMQ servers as:

failover:(tcp://10.5.1.243:61616?keepAlive=true,tcp://10.5.1.208:61616?keepAlive=true)

  1. ActiveMQ remote where the connection URI is set to the two ActiveMQ servers as:

failover:(tcp://10.5.1.243:61616?keepAlive=true,tcp://10.5.1.208:61616?keepAlive=true)

  1. Test policy that submits messages via emote policy above (#2)

    4. XML policy that consumes messages using listener above (#1)

 

This configuration utilizes the Test policy to send messages to ActiveMQ directly via the remote policy.  The messages are then consumed using the ActiveMQ listener policy which in turns forwards the messages via HTTP to a loopback service policy.

 

Testing

  1. Run the test policy a few times and then check the ActiveMQ servers. You should see all messages going to 1 server:

 

  1. Stop ActiveMQ on the server receiving all messages and see that message will now all go to the other server:

 

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.