API
Version 7.x > API > Integration Bus fires event twice View modes: 
User avatar
Member
Member
jeremy.lattimore-hfit - 10/7/2013 10:51:03 PM
   
Integration Bus fires event twice
I built a custom connector for the Integration Bus that monitors changes to a custom field in the UserSettings object. The subscription is actually watching the "cms.user" object using an asyncsnapshot model like this:

SubscribeToObjects(TaskProcessTypeEnum.AsyncSnapshot, PredefinedObjectType.USER, TaskTypeEnum.UpdateObject);

When it catches the event, it will send the update to WCF service method. Overall the code works. The problem is that for some reason every single record update gets triggered twice.

Any ideas as to why I would see this behavior?

Thanks.

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 10/8/2013 12:39:06 PM
   
RE:Integration Bus fires event twice
Are you updating the user object again in side your SubscribeToObjects method? If so, this could cause an infinite loop. You might also check to see if any other field is being updated for the user outside of your connector at the same time. Can you verify it's the same object being passed into your method?

User avatar
Member
Member
JeremyL - 10/8/2013 1:41:38 PM
   
RE:Integration Bus fires event twice
Great points.

I do not update the User record at all in that connector. It just calls a WCF service end point and logs the information. Interestingly, the field I'm watching shows up in the "ChangedColumns" collection for both events. Also, it only fires twice.

I will check into the "same object" idea. I think so, but I'm not completely sure. With the user/usersettings objects it's a little odd to deal with since you watch the user but are interested in the usersettings columns.

Thanks for the thoughts.