Preventing looped logging of integration tasks in special scenarios

This article suggests a solution for preventing looped logging of integration tasks in a bidirectional or multidirectional Integration Bus website object synchronization scenario.
In a special scenario when using the Integration Bus as a means to achieve synchronization of some specific objects between multiple sites, you will likely get a situation where an incoming task invokes the creation of object(s), that will also create another integration task, which creates a loop in logging of those changes.

Please note: Staging may already offer that functionality if you want to synchronize mutliple or all types of synchronizable objects, so consider and verify that as well.

To avoid this integration tasks logging loop, one possible option is to use CMSActionContext in your connector, in the place where you're creating and saving the new object accepted as an external task. In that construction , you can set the LogIntegration property of the CMSActionContext to false before you call the Set/Insert or Update method to store your object.

An example of such construction:

using (CMSActionContext context = new CMSActionContext()) 
  context.LogIntegration = false;
  // code that creates/saves the object goes here


Applies to: Kentico CMS 7.x
Share this article on   LinkedIn Google+