Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to fire a custom event when courier has finished publishing a node or all nodes sent.
I have added the following listener in ApplicationStarted
ExtractionManagerEvents.PostProcessedItem += ExtractionManagerEvents_PostProcessedItem;
But the event is never triggered. I have ensured this code is being called on start up of both the sender and receiving sites.
Anyone able to point me in the right direction.
I'm having the same problem. I have code to log every ExtractionManagerEvents event, but only ExtractedItemResources seems to fire...
My code is at https://github.com/alindgren/UmbracoCourier.EventsLogger
To make this simple I've got EnvA which i make amends and deploy to EnvB using courier.
I've been using your EventsLogger to see if the ExtractedItemResources will be trigger, I've put in break points on all the events trigger including the ExtractedItemResources but I can't seems to get it trigger at all when I courier things across to EnvB.
The event definitely loads as it hits into ApplicationStarted when the site first loads, but can't get into it anymore after that with Courier deploy.
TheExtractedItem event has been fixed since I posted my code so that it now works. I get the GUID of the node with e.Item.ItemId.Id. One thing that was surprising for me is that this event happens on the sending environment (I guess all the processing happens there), so the receiving environment doesn't get the event triggered. I was expecting it to happen in the environment where it was extracted. It's a little unfortunate, but I've worked around this by calling an API on the receiving environment.
Aha so the event will only be triggered at the sending end but not the receiving end?
Will you be able to share the code that you used for the receiving environment (the API calling that you have?)
The API code I have is very specific to my project. I am updating Relations for specific content types.
But it's just an UmbracoApiController webmethod that takes a Guid as a parameter. I then get the node. Here's the code (removing the project specific stuff where I put the "do stuff with node" comment:
public void UpdateRelations(Guid guid)
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
var node = umbracoHelper.TypedContent(guid);
// do stuff with node
catch (Exception ex)
LogHelper.Error<MyApiController>("Error for guid " + guid.ToString(), ex);
I have everything in a try/catch block because if there is an error, it doesn't seem to log/output a useful message.
Ic. You are calling this API from within your Sending environment within the ExtractedItemResources events.
Eg your receiving site is Receiving.com
So, in your Sending environment ExtractedItemResources event, you are calling your Receiving.com/umbraco/api/UpdateRelations/?guid=xxxxxxxxxxxxxx
To trigger the update right?
I'm using the ExtractedItem event.
Also, forgot to mention this - not sure if it's really needed -- but I was worried about overloading the server by making a lot of API calls all at once when many nodes are transferred, so I actually queue the calls to the API using Azure Storage Queue and then have the queue call the server using Azure Functions. Not sure this is needed but I already had it in place for other things.
Here is my event handler code:
private void ExtractionManagerEvents_ExtractedItem(object sender, ItemEventArgs e)
if (e != null && e.Item != null && e.Item.ItemId != null)
if (e.Item.GetType().Name == "Document")
LogHelper.Info<RegisterEvents>("item " + e.Item.ItemId.Id + " (" + e.Item.Name + ") was deployed. [type is " + e.Item.GetType().Name + "; provider: " + e.Item.Provider.Name + "]");
string baseUrl = ConfigurationManager.AppSettings["ContentDeployTarget"]; // ContentDeployTarget
IndexingQueue.QueueNode(baseUrl + "/Umbraco/Api/MyApi/UpdateRelations?guid=" + e.Item.ItemId.Id, 0);
The QueueNode method just dumps the URL in the storage queue.
One other detail - I check the type to make sure it's a "Document" because I just want to the Document - I think the event also triggers for Property Data.
Ic. Thanks Alex
Ic. Thanks Alex, I'll try it out. Helps a lot
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted