消息卡住 (Microsoft.Samples.BizTalk.Adapter.Common )

发布于 2024-12-29 02:32:48 字数 2084 浏览 1 评论 0原文

我们使用 Microsoft.Samples.BizTalk.Adapter.Common 库作为自定义 SMTP 接收适配器。除了一种情况之外,一切似乎都很好。如果邮件大小超过大约 5 MB 并且包含两个以上附件,则会卡住。我们的适配器在 isoletadHost 上运行。在查询窗口中我们看到该消息保持活动状态。在我们的调查过程中,我们发现它卡在了batch.Wait()方法中。任何其他消息处理良好。我们正在运行 Biztalk 2006 Standard。 有人可以给我们提供任何建议吗?

SyncReceiveSubmitBatch batch = new SyncReceiveSubmitBatch(transportProxy, terminator, 1);
                Int32 count = 0;
                foreach (IBaseMessage msg in messages)
                {
                    try
                    {
                        batch.SubmitMessage(msg, null);
                        count++;
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            msg.SetErrorInfo(ex);
                            batch.MoveToSuspendQ(msg);
                            ThreadContext.Properties["EventID"] = 1007;
                            logger.Error("Submit Error", ex);
                        }
                        catch (Exception ex2)
                        {
                            ThreadContext.Properties["EventID"] = 1008;
                            logger.Error("Suspend Error", ex2);
                        }
                    }
                }
                if (count != 0)
                {
                    batch.Done();
                    if (batch.Wait())
                    {
                        ThreadContext.Properties["EventID"] = 1009;
                        logger.Debug("Messages publised");
                    }
                    else
                    {
                        ThreadContext.Properties["EventID"] = 1010;
                        logger.Warn(String.Format("Publish  error. Sucssefully publised {1}, error in {0} messages", batch.FailedMessages.Count, count - batch.FailedMessages.Count));
                    }
                }
                else
                {
                    ThreadContext.Properties["EventID"] = 1011;
                    logger.Warn("No message found");
                }

We use Microsoft.Samples.BizTalk.Adapter.Common library for our custom SMTP Receive Adapter. Everything seems fine except one situation. The message stucks if it larger than approximatly 5 MB and it includes more than two attachments. Our adapter is run on isoletadHost. In query window we see that the message stay in active status. During our investigation we found that it stucks in a batch.Wait() method. Any other messages handling well. We are running Biztalk 2006 Standart.
Could anyone provide us with any suggestion?

SyncReceiveSubmitBatch batch = new SyncReceiveSubmitBatch(transportProxy, terminator, 1);
                Int32 count = 0;
                foreach (IBaseMessage msg in messages)
                {
                    try
                    {
                        batch.SubmitMessage(msg, null);
                        count++;
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            msg.SetErrorInfo(ex);
                            batch.MoveToSuspendQ(msg);
                            ThreadContext.Properties["EventID"] = 1007;
                            logger.Error("Submit Error", ex);
                        }
                        catch (Exception ex2)
                        {
                            ThreadContext.Properties["EventID"] = 1008;
                            logger.Error("Suspend Error", ex2);
                        }
                    }
                }
                if (count != 0)
                {
                    batch.Done();
                    if (batch.Wait())
                    {
                        ThreadContext.Properties["EventID"] = 1009;
                        logger.Debug("Messages publised");
                    }
                    else
                    {
                        ThreadContext.Properties["EventID"] = 1010;
                        logger.Warn(String.Format("Publish  error. Sucssefully publised {1}, error in {0} messages", batch.FailedMessages.Count, count - batch.FailedMessages.Count));
                    }
                }
                else
                {
                    ThreadContext.Properties["EventID"] = 1011;
                    logger.Warn("No message found");
                }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南…巷孤猫 2025-01-05 02:32:48

此修复:http://support.microsoft.com/kb/928078 帮助解决了问题。谢谢大家。

This fix: http://support.microsoft.com/kb/928078 helped to solve the problem. Thanks all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文