API
Version 7.x > API > Integration Bus and IntegrationProcessResultEnum View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/26/2013 1:31:27 PM
   
Integration Bus and IntegrationProcessResultEnum
I've got an outgoing connector that is doing what is expected although I have a few times where it stops all together because one task errors out. I'm trying to find out what happens to a specific task when I chnge the IntegrationProcessResultEnum value.

My current setup is by default to use ErrorAndSkip and SkipNow so the processing continues. But it doesn't seem to be working as I expect because I've checked the task log several times over the last week and have found 1 error that holds the rest of the tasks up. Seems one of these Enums isn't working as described. Anyone have any info they can share with me on this?

User avatar
Member
Member
Swainy - 9/3/2013 4:32:42 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
Hi Frogg,

Are you running your outgoing tasks using the ASynch option?

i.e. ProcessInternalTaskAsync() in your connector.

If this is the case then I have just used return IntegrationProcessResultEnum.ErrorAndSkip; as you say.

This works correctly for me. If one item errors then the rest continue as normal and you just get left with the ones that have errored.

ErrorandSkip means it will error and then try again next time the queue is activated.

Skip means it just skips and moves onto the next, but does not raise an error. I use this as I check the other system to ensure the address is in there before updating it (they have a queue at their end), if not then skip until next time.

As long as you are running asynch then each task should be run independantly.

Thanks,

Matt

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/3/2013 10:16:47 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
Thanks Matt.

I had that understanding as well. Yes, I'm using ProcessInternalTaskAsync() in my connector. What I haven't done is set the IntegrationProcessResultEnum value to Error.

From what I've seen in the tooltips in VS:

- Error: errors and stops processing (for all connectors).
- ErrorAndSkip: creates an error but should continue.
- OK: duh...
- SkipNow: not processed and should be processed later.

Is this not right? Bug?

I set my value as either OK or ErrorAndSkip and whenever a task fails, it stops the all the processing because of that one instance. Once I rerun that one failed task, the rest move on without an issue.

User avatar
Member
Member
Swainy - 9/3/2013 11:29:46 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
Interesting, I haven't noticed this failing in our system (i.e. we have set it to errorAndskip) and i'm pretty sure the other tasks continue as expected (so when it's finished processing just the ones that have failed are left in the list).

I'll take a look when i get into the office in the morning and do a simple test and feedback to you. Maybe it is a bug, but I haven't noticed this if so.

It is throwing an exception or are you setting the processresultenum and returning it?

What we did was wrap a try catch around the code block and if it threw an exception for any reason marked it as errorandskip.

Did you say you've tried SkipNow and ErrorAndSkip and neither skip over?

Thanks,

matt

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/3/2013 11:54:54 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
I too have wrapped the whole method in a simple try/catch and in the catch I set it to ErrorAndSkip and write an event.

Not sure if it is throwing an exception or not, the last error was quite a few days ago and I don't see the event any longer in the event log (was truncated), but if it does error out I set the IntegrationProcessResultEnum to ErrorAndSkip and the message to the exception.message or a custom message.

I'm using OK, SkipNow and ErrorAndSkip. I can't say for sure which one exactly it is stopping on but will keep better track of it this week.

User avatar
Member
Member
Swainy - 9/4/2013 4:25:53 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
Hi Frogg,

If you open up the integration bus queue in Site Manager as long as you have specified the errorMessage (out parameter) of the constructor then it should return the error in the queue (so you don't need to check the truncated event log).

In our catch we just set the errormessage to the innermessage of the exception so we can see the reason it's errored.

Sorry for being vague it's a while since i've looked through the integration bus work we did.

With regards to ErrorAndSkip I've done a simple test and this works as expected inside CMSSiteManager - if I choose all tasks at the bottom of the queue and synchronise then it runs through and synchronises all tasks even though a fair few have failed (I switched off a few web services to replicate).

I think in the real world environment it will try to process the transactions one after another when an action is added to the queue, so i'm guessing from your initial request it isn't doing that. I wonder if this is a bug when not running through CMSSiteManager?

Thanks,

Matt

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/4/2013 9:14:21 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
I do the same in my catch
catch (Exception ex)
{
errorMessage = ex.Message;
return IntegrationProcessResultEnum.ErrorAndSkip;
}
finally
{
// Clear translations cached during TranslateColumnsToExternal which internally calls GetExternalObjectID, GetExternalDocumentID
// This call is optional but recommended in the case where eg. collision of code names can occur
ClearInternalTranslations();
}
I'll keep watching our connector and see what I come up with and report back. I'm hopeful I'll be able to find the issue when it happens again but skeptical that it won't happen again because I'm watching it.

User avatar
Member
Member
Swainy - 9/17/2013 5:29:11 AM
   
RE:Integration Bus and IntegrationProcessResultEnum
Hi Frogg,

I think you're right on this.

I've being using ErrorAndSkip and you are right on our preview environment one of our tasks errored and then the others did not process.

I'll log a call with Support and give you an update when I get an answer back.

Thanks,

Matt