Using SDL Tridion Object Caching with Apache Active MQ

In R5.3 GA, SDL Tridion introduced Object Caching using JMS as a mechanism for synchronization of the caches. The mechanism allows cached objects, cached by the websites, to be invalidated in the event of a newer version of the object being deployed to the website. JMS based messaging provides a more scalable mechanism for cache updates than RMI based messaging which was the only option prior to R5.3.

Apache Active MQ

Apache Active MQ is an open source message broker that supports JMS 1.1 and can be used with SDL Tridion R5.3 and above. On the homepage of Apache Active MQ you will find a more detailed list of the features available. For this experiment I downloaded the 5.2.0 release of Active MQ and Java 1.5. I installed it on Windows 2003 Server, but it will work well on any platform. Once installed I ran Active MQ as per the documentation and accessed the administration interface on the URL:

http://localhost:8161/admin/

To get R5.3 working with Active MQ we need to configure the Content Broker and test that deployment is sending messages to Active MQ.

Configuring the Content Broker

To configure the Content Broker we must:

  1. Enable Object Caching
  2. Configure the RemoteSynchronization element

Enable Object Caching

The setup of caching is configured and controlled by the Broker configuration. In the Broker configuration the cache is enabled by changing the following setting from:

<ObjectCache Enabled="false">

To:

<ObjectCache Enabled="true">

Configure the RemoteSynchronization element

The RemoteSynchronization element allows a Content Deployer to communicate with one or more Content Brokers (and subsequently the Object Cache) to invalidate updated content from the cache.

The settings use RMI by default and so we must updated them to reflect the settings required for JMS. We do this by adding a connector element and specifying the class that tells the Content Broker or Content Deployer (collectively called Content Delivery) that it will connect to a JMS Server (in our case Active MQ) rather than RMI:

<Connector class="com.tridion.cache.JMSCacheChannelConnector">.

For Active MQ we need to then specify a number of properties that Content Delivery needs to make the connection to Active MQ:

<Property Name="java.naming.factory.initial" Value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
< Property Name="java.naming.provider.url" Value="tcp://localhost:61616?soTimeout=5000"/>
< Property Name="topic.Tridion" Value="TridionCCS"/>

The final result is that the configuration for the RemoteSynchronization element looks like:

<RemoteSynchronization>
< Connector class="com.tridion.cache.JMSCacheChannelConnector" Topic="Tridion"> 
<JndiContext>
< Property Name="java.naming.factory.initial" Value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
< Property Name="java.naming.provider.url" Value="tcp://localhost:61616?soTimeout=5000"/>
< Property Name="topic.Tridion" Value="TridionCCS"/>
< /JndiContext>
< /Connector>
< /RemoteSynchronization>

When Content Delivery is restarted to take the new settings into effect, new topics will be created in Active MQ with the name "TridionCCS" and communication will pass via JMS. You must check the logs generate by the Content Broker and Content Deployer to ensure that the there are no errors being generated. To ensure there are no errors then you need to publish content.