Skip to main content
Version: v13.x - Umbraco 13

Background Notifications

note

Background Notifications are available from Umbraco v13.1 onwards.

The Background Notifications setting is in appsettings.json

"uSync": {
"settings": {
"BackgroundNotifications": true
}
}

This setting will make uSync place all notifications generated during any import process (include contentSaved, contentPublished) onto a background thread.

With notifications processed asynchronously in the background, uSync will continue with any import of other items and the notifications will happen alongside or after the import process.

Performance​

This significatly reduces the amount of time that a large import will take, but notifications may process for some time after the import is completed.

Notes​

  1. If you use background notification threads, then you can no longer use the uSyncEventService to determine if uSync caused the notification to occur. Instead, you should check the notification state for the uSync notification events.

  2. Notifications on a background thread may not have access to all of the elements of Umbraco that you might expect. You can use EnsureUmbracoContext methods to make sure you have access to any Umbraco contexts you might need.

  3. The order of notifications cannot be garunteeed. Save events may be triggered after publish events. If your notifications are sensitive to the ordering of notification events you should not use the background notification setting.

  4. Errors in notification handlers will not be surfaced by uSync. Currently, uSync will report any errors that may be occuring inside notification events. When using background notifications, these errors will not be reported by the UI, although they may still appear in the Umbraco logs.