In enterprise environments there is a high chance of having your SDL Tridion Content Delivery side being hosted on an IBM WebSphere Application Server infrustructure. Â Setting up the Tridion Cache Channel Service should be done via the Java Messaging Service at places where such infrastructure exists: the client invested a lot into it probably for a good reason and failover is most likely a key requirement. Â In this article weâ€™ll take a look at how to set up the Tridion Cache Channel Service using JMS on IBM WebSphere Application Server (WAS).
IBM WAS is a very robust and complicated product, especially when you get into server clustering. Â So Iâ€™m not going to try and claim to be an expert at it. Â To be honest, I can barely click around that hideous interface without sounding like someone with a major case of Touretteâ€™s 😉 Â So youâ€™ll probably need to buddy up with an in-house WebSphere platform specialist to help out with the WAS/cluster configuration.
Note: this article is based on a configuration with WAS 7 and Tridion 2011 SP1 HR2. Â However, the same (or very similar config) should work for Tridion 2013 and 2013 SP1.
There are several things you need to take into account when working with WebSphereâ€™s Default Java Messaging Service which Iâ€™ll discuss here. Â I do expect you, the reader, to understand how the Tridion CCS works at a high level, so first please read the Tridion documentation thatâ€™s available on SDL Live (http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_5757AEB2C06D427EA5A299FAB6165052). Â Here I address items specific to WebSphere JMS configuration only. Â So let’s get started.
WebSphere MQ is NOT Required
MQ is a separate product with bangs and whistles and is not required for Tridionâ€™s CCS. SDL Tridion requires a standard JMS Provider, and every enterprise application server must have a JMS according to the JSR 914 specification.
WebSphere JMS is the default JMS provider that comes with the WebSphere Application Server. So you do not need any products beyond it.
The App Must be deployed as part of an EAR
The short story is that your web application must be part of an Enterprise Archive (EAR). You will not get away with just using a Web Archive (WAR).
The long story is that the WebSphere App Server supports Message Driven Beans only (AsyncJMS10MDB and AsyncJMS11MDB options). A Message Driven Bean is a type of Enterprise Java Bean (EJB), and EJBs must be part of the EAR in scope adjacent to the WAR. So the EJB spec must be created within the scope of the EJB Module file, not the Web Module (WAR). Here is a quick recap on all this J2EE goodness: http://docs.oracle.com/javaee/6/tutorial/doc/bnaby.html.
The conclusion is that an EAR file is required with an EJB module which specifies to use the MDB class provided by Tridion (in one of the JARs).
Tridion CCS Message Driven Bean Spec is Required
As mentioned above, you need to have an EJB module with the MDB spec that points to the Tridion MDB class.
Use Eclipse (or your favourite J2EE IDE) to create an EJB Project. This project only needs to have 1 XML file, which is the EJB spec. The Tridion jars (and the class where the spec will point to) will be part of the higher/common scope in the EAR.
The spec (inside ejbModule->META-INF->ejb.jar.xml):
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2003 Sun Microsystems, Inc. All rights reserved. -->
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee"
Iâ€™m working with the Tridion Documentation team to get this added to the official SDL Live docs, hopefully making this article obsolete once SDL Live is updated.
- Follow the official documentation on SDL Live to configure the Object Cache in your cd_storage_config.xml file.
- In WAS, create a Topic Connection Factory and a Topic for your Tridion Cache Channel. (This is where your WebSphere specialist/admin buddy does his/her magic.)
- Make sure to enable cache logging as per this article: http://sdltridionworld.com/articles/sdltridion2011/analyzing_object_cache.aspx. Youâ€™ll be able to see if your cache config is working or not.
- Put the Tridion Content Delivery JARs in the EAR, not the WAR.
- Donâ€™t forget to add your EJB module with the Tridion MDB spec to the EAR.
- Get a JMS Queue monitoring tool so that you can see the Tridion CCS invalidation messages get added and consumed in the queue. Â HermesJMS is a really good one and itâ€™s open source: http://www.hermesjms.com/confluence/display/HJMS/Home
- Remember, if youâ€™re testing the config in a Staging or new Production environment, there is a high chance that the JMS may be in a different network segment from your developer machine, so you wonâ€™t be able to use HermesJMS to inspect the queue. Â Works wonders in Dev though!
- All instances of the Deployers and your web apps should have the Object Cache with RemoteSynchronization enabled. Â The config should be something like the following, but do consult the official SDL Live docs for this:
<Property Name="java.naming.factory.initial" Value="com.ibm.websphere.naming.WsnInitialContextFactory" />
<Property Name="java.naming.provider.url" Value="corbaloc::myserver1:9814,:myserver2:9814" />
You should now be good to go and run some tests.
The Cache Channel Smoke Test
You need a baseline by which to tell whether CCS is working as expected. Â Essentially, you need to ensure that when new content is published, old content gets invalidated and each web appâ€™s object caches are updated. Â Here is my simple test:
- Publish a DCP until successfully deployed.
- Hit a page on your site that retrieves the DCP and monitor the caching log to ensure it gets inserted into the Object Cache (see below for how to enable the cache log).
- Update the content of your Component in Tridion and republish that Componentâ€™s DCP.
- Hit the page where this DCP exists (i.e. refresh the page from step 2). The expected result is that the DCP should be updated with the new content.
Once you get this working, the performance of your J2EE Tridion-driven website surges. Â It’s an amazing feeling to have this thing up and running. Â Hopefully this article makes the process a lot smoother for the next person doing it.
Analyzing the Object Cache
Tridion and JMS: removing another SPOF
How to configure JMS for Cache Channel Service
Andy Lim from SDL P.S. for helpful advice and his ability to creatively operate outside the box.
Jeff Wisor from SDL Support for his helpful and quick tips with next steps.
Ram G. for his presentation at the 2012 MVP Retreat on â€œDemystifying the Tridion CCSâ€ and providing additional tips via Tridion Stackexchange.
Sumit Malvi [my amazing clients (I donâ€™t know if Iâ€™m allowed to mention company names)]. Sumit is the WAS specialist buddy I mentioned above. Thanks for educating and refreshing my memory with all the J2EE goodness. Despite the long hours, it was a pleasure seeing this CCS thing coming to life.
Sreedhar Sundaram [also my amazing client]. Thanks for your support, ideas and direction in getting this accomplished. After that week, in my mind you are now the official Tridion CCS guru.
Happy Tridionizing! Â and Happy New Year!!!