Listening to Curator Server events via RabbitMQ

Updated on December 9th, 2022

This document describes how to listen to Curator Server events via RabbitMQ and is correct for Curator 3.5.

The following information is supplied with the assumption that you have a working RabbitMQ installation.
If you do not have a working install, please check the Curator installation documentation and then return to this article for the remaining steps.

Overview

Curator Server publishes events onto a RabbitMQ server in various scenarios. These events can be listened to by a third party client and used in a variety of ways - for example, they can be added to an analytics database, filtered and added to a notification system or used to synchronise with a third party system.

RabbitMQ is an established message service that uses a standard AMQP protocol. In this software, messages are posted to an exchange, and queues are created that subscribe to some or all of the messages on an exchange. That queue is then listened to by one or more message consumers and messages can be immediately received (depending on the consumer’s implementation).

Some of these queues are created for internal Curator usage, for example for File Server synchronisation or Curator Analytics.

Setting up RabbitMQ

In this section, we will describe how to set up RabbitMQ.

In order to bind a queue, you MUST create a new queue specific to the required use. Using any existing queue can cause system instability.

Creating a RabbitMQ Queue

In order to use the messages, the first step is to create a queue that can be subscribed to. This is done in the RabbitMQ interface, in the Queues tab.

The simplest queue can be defined simply by the following parameters:

Type: Classic

Name: This can be any suitable name, ideally descriptive; avoid using names that start with IPV or Services. We suggest starting with External or the customer name.

Durability: Durable

Auto delete: No

Any additional queue settings can be tailored to the requirements of the queue, and will not affect usage directly.

Please note that we can also create the queue via the API.

Subscribing to an Exchange

Once you have a queue created, you can subscribe to an exchange. To do this, go to the exchange page, and click on the Exchanges tab, then select the Exchange you want to subscribe to from the list of Exchanges. In this case it is Curator.Asset.Events.

Towards the bottom of the page is a form where you can bind to this queue.

Use the following settings:

The queue should be the queue you just created

Routing key will be one of the routing keys described below. Typically this might be Services.CuratorServer.Entities.Events.AssetAddedOrUpdatedEvent which is all messages about assets that are updated.

When this has been filled in, click Bind, and the queue will be ready for use.

It is possible to bind multiple routing keys to the same queue, but be warned that the message payload does not include the event type; it is included in the type property of the message and the routing key however.

Curator Server Routing Keys

Messages on the Curator.Asset.Events exchange are posted with one of several routing keys which indicate what sort of event this is. The following are possible values for the routing key.

Services.CuratorServer.Entities.Events.AssetAddedOrUpdatedEvent - This is sent whenever any metadata is edited or the asset is created in the first place.

Services.CuratorServer.Entities.Events.AssetCheckedInEvent - This is sent when a production is checked in.

Services.CuratorServer.Entities.Events.AssetCheckedOutEvent - This is sent when a production is checked out

Services.CuratorServer.Entities.Events.AssetCopiedEvent - This is sent when an asset is copied (ie added to a collection) - this should be avoided as future support may no longer send this event.

Services.CuratorServer.Entities.Events.AssetDelayedDeleteEvent - This is sent when an asset is sent to trash.

Services.CuratorServer.Entities.Events.AssetDeletedEvent - This is sent when an asset is deleted from Curator Server.

Services.CuratorServer.Entities.Events.AssetMovedEvent - This is sent when an asset is moved to another folder.

Services.CuratorServer.Entities.Events.AssetThumbnailSetEvent - This is sent when a thumbnail is set on an asset; note this includes the default proxy pending thumbnails.

Using the Messages

Messages can be received by subscribing to the queue in third party software; this is beyond the scope of this document to describe. However, they can be viewed in the RabbitMQ interface if needed on the Queue page.

The messages are formatted as JSON objects, and typically have the following structure:

{
    "OldAsset": {
        "$type": "Services.CuratorServer.Entities.Assets.V2.CS_FolderV2, Services.CuratorServer.Entities",
        "Id": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
        "Name": "List Of Assets - CHECKSUM-NEW",
        "FolderId": "7e8aba57-7689-4120-9b6f-be44e54bfc85",
        "Description": "List Of Assets created for Send To plugin with destination CHECKSUM-NEW at 21/10/2022 10:25:03 for user Admin",
        "AssetType": 8,
        "IngestDateTime": "2022-10-21T09:25:04Z",
        "ModifiedDateTime": "2022-10-21T09:25:09Z",
        "DeleteDateTime": null,
        "Metadata": [{
                "display_order": 0,
                "display_name": "Asset History",
                "name": "AssetHistory",
                "value": "2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;",
                "type": 1,
                "pattern": null,
                "permission": 2,
                "searchable": false,
                "MultiValued": false,
                "Values": ["2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;"]
            }
        ],
        "MasterId": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
        "FolderPath": "Users\\Admin20221021_102502\\List Of Assets - CHECKSUM-NEW",
        "Path": null,
        "FolderType": 4,
        "NumberOfChildren": 0,
        "Permissions": 0,
        "HasThumbnail": false
    },
    "Update": true,
    "FolderAndPermissionDetails": {
        "Asset": {
            "$type": "Services.CuratorServer.Entities.Assets.V2.CS_FolderV2, Services.CuratorServer.Entities",
            "Id": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
            "Name": "List Of Assets - CHECKSUM-NEW",
            "FolderId": "7e8aba57-7689-4120-9b6f-be44e54bfc85",
            "Description": "List Of Assets created for Send To plugin with destination CHECKSUM-NEW at 21/10/2022 10:25:03 for user Admin",
            "AssetType": 8,
            "IngestDateTime": "2022-10-21T09:25:04Z",
            "ModifiedDateTime": "2022-10-21T09:25:09.3416599Z",
            "DeleteDateTime": null,
            "Metadata": [{
                    "display_order": 0,
                    "display_name": "Asset History",
                    "name": "AssetHistory",
                    "value": "2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;",
                    "type": 1,
                    "pattern": null,
                    "permission": 2,
                    "searchable": false,
                    "MultiValued": false,
                    "Values": ["2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;"]
                }, {
                    "display_order": 0,
                    "display_name": "LastDeliveryDate",
                    "name": "LastDeliveryDate",
                    "value": "2022-10-21T09:25:09Z",
                    "type": 5,
                    "pattern": null,
                    "permission": 2,
                    "searchable": false,
                    "MultiValued": false,
                    "Values": ["2022-10-21T09:25:09Z"]
                }
            ],
            "MasterId": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
            "FolderPath": "Users\\Admin20221021_102502\\List Of Assets - CHECKSUM-NEW",
            "Path": null,
            "FolderType": 4,
            "NumberOfChildren": 0,
            "Permissions": 1,
            "HasThumbnail": false
        },
        "WorkgroupIds": ["dbb639db-abe5-11ea-b997-0a002700000a"],
        "FolderIds": ["7e8aba57-7689-4120-9b6f-be44e54bfc85"],
        "FolderPaths": ["00000000000000000000000007205312\\7E8ABA57768941209B6FBE44E54BFC85\\3D698B7FE44843B3AD5FCDA434A8D0F2"],
        "NameFolderPaths": ["Users\\Admin20221021_102502\\List Of Assets - CHECKSUM-NEW"]
    },
    "Status": 1,
    "Asset": {
        "$type": "Services.CuratorServer.Entities.Assets.V2.CS_FolderV2, Services.CuratorServer.Entities",
        "Id": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
        "Name": "List Of Assets - CHECKSUM-NEW",
        "FolderId": "7e8aba57-7689-4120-9b6f-be44e54bfc85",
        "Description": "List Of Assets created for Send To plugin with destination CHECKSUM-NEW at 21/10/2022 10:25:03 for user Admin",
        "AssetType": 8,
        "IngestDateTime": "2022-10-21T09:25:04Z",
        "ModifiedDateTime": "2022-10-21T09:25:09.3416599Z",
        "DeleteDateTime": null,
        "Metadata": [{
                "display_order": 0,
                "display_name": "Asset History",
                "name": "AssetHistory",
                "value": "2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;",
                "type": 1,
                "pattern": null,
                "permission": 2,
                "searchable": false,
                "MultiValued": false,
                "Values": ["2022-10-21T09:25:08.9156600Z,Process Engine,Scratchpad Sent To CHECKSUM-NEW;"]
            }, {
                "display_order": 0,
                "display_name": "LastDeliveryDate",
                "name": "LastDeliveryDate",
                "value": "2022-10-21T09:25:09Z",
                "type": 5,
                "pattern": null,
                "permission": 2,
                "searchable": false,
                "MultiValued": false,
                "Values": ["2022-10-21T09:25:09Z"]
            }
        ],
        "MasterId": "3d698b7f-e448-43b3-ad5f-cda434a8d0f2",
        "FolderPath": "Users\\Admin20221021_102502\\List Of Assets - CHECKSUM-NEW",
        "Path": null,
        "FolderType": 4,
        "NumberOfChildren": 0,
        "Permissions": 1,
        "HasThumbnail": false
    },
    "User": {
        "DateCreated": "2020-06-11T13:14:56Z",
        "DateUpdated": "2020-06-11T13:54:52Z",
        "Description": null,
        "Email": "a@b.com",
        "Username": "sysadmin",
        "RealName": "System Administrator",
        "UserId": "a9fd290b-9399-4844-a408-8ca82b7f1677",
        "MaxEDLSeconds": 0,
        "StoryboardingEnabled": false,
        "Permissions": 0,
        "Source": "CURATOR",
        "IsActive": true
    },
    "Client": {
        "Id": "ec24d015-3407-44fb-83a5-2707ed28b4d7",
        "Name": "Process Engine Service"
    },
    "TimeStamp": "2022-10-21T09:25:09.4786595Z",
    "RemoteIpAddress": "fe80::3d07:6d2d:3568:5669%10"
}

 

Was this article helpful?