Skip to main content

Posts

Showing posts from July, 2014

Custom Cache Invalidation using JMS

Let's say you have your own application or a custom cache that stores some Tridion items for better performance. You are not relying solely on the Tridion object cache, and you built your own cache layer on top of it. You don't want to serve stale content or use a dummy time-to-live cache, and you chose an elegant dependency cache implementation. This implies you need to intercept the cache 'invalidate' messages from the Tridion Deployer and use them to remove the updated items from your custom cache. This is exactly the setup I happen to have -- DD4T Java web-application using RESTful services providers. The DD4T application makes no use of Tridion APIs whatsoever, everything being abstracted in the services layer. The DD4T factories call the service-based providers and cache the returned models in a local EHCache. Naturally, I need an elegant cache notification mechanism to flush the items in the EHCache that are updated by a publish action. The Cache Channel Servic...

Setup Apache ActiveMQ

This is a follow up of my previous post JMS Cache Channel Setup . The goal is to configure JMS cache invalidation for Tridion Content Delivery. In my previous post I was describing how to configure the Tridion Deployer to use JMS technology and to post cache notification messages to an Apache ActiveMQ server. This post describes the steps I took to install and configure ActiveMQ on my machine. I started my endeavor without having any prior experience with ActiveMQ. To my surprise, the installation was a breeze and took me about 20 minutes to get everything running. I started by visiting the home of ActiveMQ -- activemq.apache.org . The latest version as of the day was 5.10.0. I followed the no-nonsense guide on the home page and I first downloaded ActiveMQ. I use a Mac (like every freelancer who respects himself :-p) and I personally love FreeBSD, so I downloaded the Unix/Linux/Cygwin Distribution . Namely, a file named apache-activemq-5.10.0-bin.tar.gz . The Getting Starte...

JMS Cache Channel Setup

In my current project, we are implementing the Tridion Cache Channel Service using JMS technology. Without having installed it previously I used to regard this as a little bit of voodoo. I started doing my due diligence research on the topic, only to find out that actually there are quite a few resources out there on JMS in general (doh!), as well as in conjunction with Tridion specifically. There are some great blog posts on JMS consumption and setup from Bruce Snyder: bsnyderblog.blogspot.com/2010/02/using-spring-to-receive-jms-messages bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in And a concise, but great post from Julian on enabling JMS for a Tridion Deployer: sdltridionworld.com/articles/usingsdltridionobjectcachingwithapacheactivemq A Bit of Architecture In a classic configuration (i.e. one using RMI), the Cache Channel Service (CCS) is running as a separate process, most likely a small stand-alone Java application. In a JMS configur...

Label Service in DD4T Java

Many times over we need to implement a Label service mechanism in our projects. This post shows one such approach for DD4T Java. The idea is to have a Labels Page published from Tridion containing the Labels Component on it. The labels are simply multi-valued Key - Value pairs represented by an Embedded Schema. The Labels page is read in DD4T and the labels on it are parsed and loaded into a java.util.Map. The front end code employs a custom JSP tag to read the label map and display the associated value for a given key. Content Manager Part We use Schema Label with a field ' label ' of type Embedded Schema, multi-valued. The Embedded Schema is ' Embedded label ' and contains two field, both single value text fields: ' key ' and ' value '. We create a Component ' Labels ' and populate it with our labels. This Component can be localized and translated in sub-Publications, as the Label Service can use context-aware Components to loa...