Skip to main content

Posts

Showing posts with the label Content Delivery

Content Delivery Monitoring in AWS with CloudWatch

This post describes a way of monitoring a Tridion 9 combined Deployer by sending the health checks into a custom metric in CloudWatch in AWS. The same approach can also be used for other Content Delivery services. Once the metric is available in CloudWatch, we can create alarms in case the service errors out or becomes unresponsive. The overall architecture is as follows: Content Delivery service sends heartbeat (or exposes HTTP endpoint) for monitoring Monitoring Agent checks heartbeat (or HTTP health check) regularly and stores health state AWS lambda function: runs regularly reads the health state from Monitoring Agent pushes custom metrics into CloudWatch I am running the Deployer ( installation docs ) and Monitoring Agent ( installation docs ) on a t2.medium EC2 instance running CentOS on which I also installed the Systems Manager Agent (SSM Agent) ( installation docs ). In my case I have a combined Deployer that I want to monitor. This consists of an Endpoint and a...

Toolkit - Tricks with Memory Byte Buffer

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. In previous post Writing My Own Database Engine , I quickly mentioned the use of Memory Byte Buffer from Jana NIO that provides fast access to a file by mapping its content to memory. This post goes into more detail over some tricks that occurred with that implementation. There is an issue with Memory Byte Buffer. Namely, once it is created by calling FileChannel.map method, it cannot be unmapped, closed or discarded. The byte buffer will exist until it is garbage collected. From the JavaDoc: A mapping, once established, is not dependent upon the file channel that was used to create it. Closing the channel, in particular, has no effect upon the validity of the mapping. A mapped byte buffer and the file mapping that it represents remain valid until the buffer itself is garbage-collected. The issue is affects Windows OS Java implementations, in the sens...

Toolkit - Writing My Own Database Engine

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. In the previous post  Criteria for Dynamic Queries , I presented index classes that allow us to execute performant lookups for keys in indexes on the file system. This post presents the logic behind these indexes. The requirement for the Toolkit API was not to use a database or a third party product such as search engines or indexers. In order to do searches for content on a file system where we had JSON files filled with properties we want to search on, we need to have indexes of those properties. It would be impossible to do performant searches without such indexes. This meant creating my own indexes and indexing logic (put, get) backed by a fast searching algorithm. In other words, it meant writing my own simple database engine. The rationale looks like this: Each query must be as fast as possible. The fastest way to query would be to lookup a key in a...

Toolkit - Criteria for Dynamic Queries

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. In the previous post  Dynamic Content Queries , I presented a Query class that performs CustomMeta queries on JSON models published to the file system. This post presents the logic that actually queries for results and applies different boolean operators for different Criteria. The base class for each criteria is Criterion, which defines the base methods each criteria must implement: public abstract class Criterion { public Set < String > executeQuery () { return executeQuery ( FilterImpl . EMPTY_FILTER ); } public abstract Set < String > executeQuery ( Filter filter ); } The Filter class contains a set of allowed Publication ids, the item type and whether to include the range boundaries or not. The Filter is used in modifying the results retrieved for each criteria from the indexes. Each criteria uses...

Toolkit - Dynamic Query Sorting and Pagination

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. In the previous post Dynamic Content Queries , I presented a Query class that performs CustomMeta queries on JSON models published to the file system. This post presents the logic that sorts and paginates the result set. The Query class defines four members that help the pagination and sorting logic: Sorter -- the Comparator that perform the actual sorting of two ItemMeta objects (it returns an order between two ItemMeta instances); page -- the page index to return out of all pages; pageSize -- the number of items on a page; totalItemCount -- the total number of items before pagination was applied; Sorting Sorting can be specified on different columns and can use different directions for each column (ascending, descending). A sort column is a predefined metadata of a model (title, last publish date) or a CustomMeta. An association between a sort column an...

Toolkit - Dynamic Content Queries

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. This post presents the Dynamic Content Query capability. The requirements for the Toolkit API are that it should be able to provide CustomMeta queries, pagination, and sorting -- all on the file system, without the use third party tools (database, search engines, indexers, etc). Therefore I had to implement a simple database engine and indexer -- which is described in more detail in post Writing My Own Database Engine . The querying logic does not make use of cache. This means the query logic is executed every time. When models are requested, the models are however retrieved using the ModelFactory and those are cached. Query Class This is the main class for dynamic content queries. It is the entry point into the execution logic of a query. The class takes as parameter a Criterion (presented below) which triggers the execution of query in all sub-criteria of a...

Toolkit - Custom Tags Execution while Assembling

This post if part of a series about the  File System Toolkit  - a custom content delivery API for SDL Tridion. This post presents the TagFactory in charge with execution of custom tags for the Toolkit Component Presentations. The content of Dynamic Component Presentations can contain custom tags in the form of <mytag>some body</mytag> . These XML-like nodes are backed by a Java class that is executed when the tag is rendered. The configuration of tag names and Java class name is done in file toolkit.properties. More information is available in post Installation and Configuration . The custom tag support uses the following concepts: TagFactory -- the entry point into execution of tags for a piece of content; TagSupport -- class that associates a tag name with a tag implementation class; TagRenderer -- interface that a tag implementation class must implement; TagRenderer Interface This is the interface that any tag class must implement. It contains on...