To synchronize caches using JMS, get a JMS provider up and running, configure a Connector for JMS, specifying the implementing Java class, and specify a Topic, Topic Connection Factory, and Strategy.
Before you begin
Note: Cache Channel Service using JMS does not support durable messages. That is, if the client goes offline and resumes at a later time, the Cache Channel Service does not receive any missed cache invalidation messages.
Procedure
- Set up a JMS provider, such as Apache Active MQ, on a machine of your choosing.
- In all SDL Web Web applications and microservices where caching is enabled, open the Storage Layer configuration file cd_storage_conf.xml in a plain-text or XML editor.
- Inside the
ObjectCache element, insert a RemoteSynchronization element as the last subelement, and create a Connector subelement inside it.
- Give the
Connector subelement the following attributes:
| Attribute | Value |
|---|
Class | com.tridion.cache.JMSCacheChannelConnector |
Topic | The JMS topic to which the Connector is to publish its cache events |
TopicConnectionFactory | The Factory that creates topic connections to the JMS provider. |
Strategy | The JMS strategy used. |
The value for
Strategy, the JMS strategy used, is one of the following:
| Strategy name | Description |
|---|
AsyncJMS10 | JMS 1.0-compliant asynchronous messaging |
AsyncJMS11 | JMS 1.1-compliant asynchronous messaging. The attribute defaults to this value if left empty. |
AsyncJMS10MDB | JMS 1.0-compliant Message Drive Bean messaging |
AsyncJMS11MDB | JMS 1.1-compliant Message Drive Bean messaging |
SyncJMS11 | JMS 1.1-compliant synchronous messaging |
Note that the Message Driven Bean JMS strategies can only send messages, not receive them. As such, they are not to be used on the Presentation Server (where you should use the asynchronous equivalent instead), but can be used in your Content Deployer Server Role.
- Use the
JndiContext subelement of the Connector element to set a number of named properties in the form of Property elements.
The properties typically specify (among others) where to locate the JMS provider, and their names and values depend on the JMS provider used. For example, when using ActiveMQ, you would set the following properties:
<JndiContext>
<Property Name="java.naming.factory.initial" Value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
<Property Name="java.naming.provider.url" Value="tcp://providerdb.domain.name:61616?soTimeout=5000" />
</JndiContext>
- Copy resources from your JMS provider as needed to your library location. For example, if you use Apache Active MQ, copy the following files from your Active MQ library folder:
- activemq-client-5.12.1.jar
- geronimo-j2ee-management_1.1_spec-1.0.1.jar
- geronimo-jms_1.1_spec-1.1.1.jar
- geronimo-jta_1.0.1B_spec-1.0.1.jar
- hawtbuf-1.11.jar
- Save and close cd_storage_conf.xml.
- Restart the Web application or microservice.