0

I'm using Microsoft BizTalk Server 2020 with Office365 Outlook Email adapter in a Receive Port.

Adopting a custom pipeline (with custom component) receiving a mail, when a pipeline error occurs, the message doesn't suspend, and I've these errors in the application event log:

Level Source Event ID Task Category Description
Warning BizTalk Server 5740 BizTalk Server The adapter "Office365 Outlook Email" raised an error message. Details "There was a failure executing the receive pipeline: "..." Source: "CustomComponent" Receive Port: "RP_Mail" URI: "O365Mail://mailaddress/folder" Reason: ... ".
Error BizTalk Server 5677 BizTalk Server The Messaging Engine encountered an error while suspending one or more messages.
Error BizTalk Server 5719 BizTalk Server There was a failure executing the receive pipeline: "..." Source: "CustomComponent" Receive Port: "RP_Mail" URI: "O365Mail://mailaddress/folder" Reason: ...

(Names omitted)

If I put PassThru pipeline into Receive Location, obviously I don't have any issue: the mail is read correctly and sent to Message Box. But, for the application I'm developing, I need to check the attachment name and suspend bad messages.

The Custom Component tries to receive attachment information, and if the attachment name doesn't respect some condition, I have to suspend the message.

Here is the code:

    public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
    {
        if (pInMsg.BodyPart != null)
        {
            string emailAttachmentName = "NOT_FOUND";
    
            // Loop through the message parts (mail attachments)
            for (int i = 1; i < pInMsg.PartCount; i++)
            {
                // Save the name of the part/attachment into partName
                pInMsg.GetPartByIndex(i, out string partName);
                
                // Check if extension of attachment is .ang
                if (Path.GetExtension(partName).ToLower() == ".ang")
                {
                    // Save the name to var and exit loop
                    emailAttachmentName = partName;
                    break;
                }
            }
    
            // If not found, suspend the message
            if (emailAttachmentName == "NOT_FOUND") throw new ApplicationException("ERROR.");
    
        }
        return pInMsg;
    }

I have only these 3 logs, no message suspended in the Administration console and the only two ways to see if pipeline fails are:

  1. checking physical mail folder to see if message has been read or not
  2. checking event log

After a few minutes of having these errors, the receive port tried to read the mail one more time and once again I got the errors (and so on...). I've also installed CU4.

Is there a way I can suspend the message in the Administration console?

The main problematic mistake is the second one:

Error

I've tried to change adapter handler, restart instances, change mail address and folder, force routing message port errors, install CU4

Ken White
  • 123,280
  • 14
  • 225
  • 444
lorenzo
  • 11
  • 4

0 Answers0