none
Send Error Type or Description of failed messgaes in body of mail using SMTP adapter RRS feed

  • Question

  • Hi,

    I want to send failed messages error type or description to admin to notify him for error occurs in BizTalk, with Error description in body part.

    I have set Send port option for "Enable routing of failed messages" and created a send port having SMTP adapter. Now in body I want to send error description.

    Pls advise how can I achieve this.


    -- Kind Regards Sandeep

    Tuesday, March 18, 2014 9:26 AM

Answers

  • When failed message routing is enabled, BizTalk Server does not suspend the message—it routes the message instead. When a failed message is generated, BizTalk Server promotes error-report-related message context properties and demotes regular message context properties before publishing the failed message. Compare this to the default behavior when failed message routing is not enabled: Messages that fail are suspended. -------- MSDN

    So if i were in this situation i would prefer to route the failed message to SMTP as well as to some kind of transport from which i can again receive the message ( like MSMQ or File).

    I mean create a send port group and bind 2 send port to this group (SMTP and MSMQ) and bind this group to that orchestration (specified in previous post) which subscribe the Failed Messages. Then bind the MSMQ location to your receive location to retry.

    I am not sure wheather it is the optimal solution or not ..... but it will work. Kindly let me know if you are not clear with what i said.

    Regards 

    • Marked as answer by Pengzhen Song Monday, March 24, 2014 1:53 AM
    Wednesday, March 19, 2014 6:44 AM

All replies

  • Here is a similar post on stackoverflow which may help you:

    http://stackoverflow.com/questions/5634591/biztalk-exception-handling-and-send-alert-to-system-administrator


    If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Tuesday, March 18, 2014 10:38 AM
  • Hi,

    My way to do this scenario is by using dynamic Smtp port in orchestration.

    By using "Failed message routing" we can publish the failed message to msgbox.
    Now subscribe this message from msgbox to an orchestration and by using "ErrorReport.Description" extract the error description to variable.

    Then construct the message to send with "SMTP.EmailBodyText" for SMTP.

    Regards

    Tuesday, March 18, 2014 10:48 AM
  • Ohh...

    I have just tested it and no need to use Dynamic Port, you can do it with specify later also.

    1. In receive port use "Failed message routing".

    2. Subscribe the failed message from msgbox by an orchestration.

    3. In Expression shape extract the error description from the message like :

                varErrDesc=MsgRecv(ErrorReport.Description);

    4. In construct message shape assign the varErrDesc to  "SMTP.EmailBodyText" like :

             MsgSnd(SMTP.EmailBodyText)=varErrDesc;

    5. Configure the send port in admin console to SMTP transport.

    Regards


    • Edited by Rohit Shahi Tuesday, March 18, 2014 11:40 AM
    Tuesday, March 18, 2014 11:39 AM
  • Hi Rohit,

    Thanks for your reply.

    Pls advise if I subscribe to a failed message to a orchestration,I cannot see message in Admin console, as there is scenario where due to network failure message could not be send to SAP port so it will retry for that port.

    Now if i route failed message i cannot retry on SAP port.

    I would be looking for solution where admin will be notified with error message, but message should be there in admin console of biztalk

    Pls advise


    -- Kind Regards Sandeep

    Wednesday, March 19, 2014 4:05 AM
  • When failed message routing is enabled, BizTalk Server does not suspend the message—it routes the message instead. When a failed message is generated, BizTalk Server promotes error-report-related message context properties and demotes regular message context properties before publishing the failed message. Compare this to the default behavior when failed message routing is not enabled: Messages that fail are suspended. -------- MSDN

    So if i were in this situation i would prefer to route the failed message to SMTP as well as to some kind of transport from which i can again receive the message ( like MSMQ or File).

    I mean create a send port group and bind 2 send port to this group (SMTP and MSMQ) and bind this group to that orchestration (specified in previous post) which subscribe the Failed Messages. Then bind the MSMQ location to your receive location to retry.

    I am not sure wheather it is the optimal solution or not ..... but it will work. Kindly let me know if you are not clear with what i said.

    Regards 

    • Marked as answer by Pengzhen Song Monday, March 24, 2014 1:53 AM
    Wednesday, March 19, 2014 6:44 AM