none
bts receiving duplicate messages from mscrm RRS feed

  • Question

  • We are having a rather heated discussion about the following topic.

    CRM is (sometimes) sending duplicate messages to BizTalk (wcf-service) ...up to 4 times within a very short time (a second).

    I'm not really willing to implement a logic to check if I received this message already (there is an id in there). In my opinion there is something not quite right in the sending applilcation that causes it to send so many times. The CRM-guys say that BizTalk should keep track of that id and should check if it was already received or not and discard if it was.

    Untill now I did not have to do this anywhere in our system. So is it me being difficult? And should I give in?

    If yes and I should implement this , than shouldn't I have to do this for all messages I receive?

    f.e.  where it is important not to have duplicates, as for messages coming from a wharehouse system that impact stock

    I'm just worried about the impact it will have on the processing of messages if I start doing a lot of stuff like this...


    Kind regards Isabelledc

    Thursday, October 22, 2015 6:59 AM

Answers

  • Ok..As i know the plug-ins in CRM are event based that means when some event happens(e.g contact save,update etc...) it fires the plug-in.

    Since BizTalk is receiving duplicate message i only think of the below reasons

    1.The plug-in is executing more than once for a single event

    2. Or the plug-in is exectung for different events(e.g. status changes on contact) and you are receiving the same message as you don't know what is changed fom the message.

    So please sit with CRM team and try to find the root cause of trigger and then you can decide where to fix the problem ..on CRM side or BizTalk side...

    All i am saying is insteade of focussing on the solution, first try to find the root cause which gives asn idea what needs to be fixed.

    Cheers


    JB

    • Proposed as answer by Angie Xu Friday, October 30, 2015 2:25 AM
    • Marked as answer by Angie Xu Sunday, November 1, 2015 2:33 PM
    Friday, October 23, 2015 9:55 PM

All replies

  • No ,This is not a good approach to have duplicate message posted to BizTalk for processing . I would suggest to check with the CRM Team and tell them the Duplicate message can cause you data integrity issue with the downstream system were same record will be stored multiple times .

    BizTalk as a integration layer should not hold the message and validate with the incoming message as overall process can kill the benefits of BizTalk .BizTalk should be used a Business process automation tool for integration and these types of validation should be part of CRM system instead of throwing it for BizTalk for processing .

    Thanks

    Abhishek

    Thursday, October 22, 2015 7:38 AM
  • Hi,


    Can you please tell us how crm is sending the messages to BizTalk? 

    Cheers


    JB


    Thursday, October 22, 2015 7:57 AM
  • I vote for  what Abhishek has just said. BizTalk should never do such things. Its not menat for that. If CRM is duplicating the message it should be fixed there.

    If the CRM guys cant fix it then look for DB solution or some other appropiate approach. Holding message in BizTalk not a intelligent move at all.

    Keep a DB in backend. For each CRM reqquest have an entry there about the received Id. BizTalk can check if the id that it received is in the DB, discard if present, process if not. You can build somehing like this.

    But as Old ppl say issue should be fixed where it occurs. In ur case in CRM. U cant propagate issues to downstream system and ask them to deal with it.

    With that logic u can say that whoever is getting the data from BizTalk should check if it has already received and discard if duplicate.

    If at all the CRM guys cant fix it and there is no solution then U go for workarunds and patch.


    Regards <br/> When you see answers and helpful posts,<br/> please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Thursday, October 22, 2015 8:07 AM
    Answerer
  • The CRM-guys say that BizTalk should keep track of that id and should check if it was already received or not and discard if it was.

    ...

    And should I give in?

    The answer is very simple, NO and NO!  This is not your problem.

    First, the CRM team has to make absolutely sure that there isn't a valid reason messages are being send >1 times.  They then need to document the findings with both their and your management.

    However, if it's determined that CRM cannot change this behavior, then, unfortunately, it's something you have to handle.  At this point, the most important thing is to make sure your management completely understands that the problem is with CRM and you have to take a lot of extra time to accommodate their issue.  This is not a problem with your app or BizTalk Server.

    As for how, having done exactly this before, create a table in a database you own to track the received IDs, whatever ID is appropriate.  Then you have to check each message that comes in.  Just use a Stored Procedure called through the WCF SQL Adapter in an Orchestration.  Don't worry about 'performance'.

    Thursday, October 22, 2015 11:50 AM
    Moderator
  • Hi Isabelle,

    CRM is (sometimes) sending duplicate messages to BizTalk (wcf-service) ...up to 4 times within a very short time (a second).

    I just want to understand the pattern you implemented here...How CRM is posting the messages to BizTalk? Have you exposed schema as web service in BizTalk which CRM is calling?

    Cheers


    JB

    Thursday, October 22, 2015 8:24 PM
  • I'm not quite sure but i know they use plug-ins usually, so i am guessing itnwill be using a plug-in

    Kind regards Isabelledc

    Friday, October 23, 2015 6:03 AM
  • Indeed, i have exposed a schema as a webservice

    Kind regards Isabelledc

    Friday, October 23, 2015 6:04 AM
  • Ok..As i know the plug-ins in CRM are event based that means when some event happens(e.g contact save,update etc...) it fires the plug-in.

    Since BizTalk is receiving duplicate message i only think of the below reasons

    1.The plug-in is executing more than once for a single event

    2. Or the plug-in is exectung for different events(e.g. status changes on contact) and you are receiving the same message as you don't know what is changed fom the message.

    So please sit with CRM team and try to find the root cause of trigger and then you can decide where to fix the problem ..on CRM side or BizTalk side...

    All i am saying is insteade of focussing on the solution, first try to find the root cause which gives asn idea what needs to be fixed.

    Cheers


    JB

    • Proposed as answer by Angie Xu Friday, October 30, 2015 2:25 AM
    • Marked as answer by Angie Xu Sunday, November 1, 2015 2:33 PM
    Friday, October 23, 2015 9:55 PM