无法路由已发布的消息,因为找不到订阅者

The published message could not be routed because no subscribers were found

我在服务器中 运行 我的 BizTalk 程序包时出现以下错误:

无法路由已发布的消息,因为找不到订阅者

套餐说明: 使用存储过程将 CSV 平面文件导入 SQL 服务器。

细分:

创建Table代码:

CREATE TABLE [dbo].[Accounts](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [AccountName] [nvarchar](150) NULL,
    [ServiceAddress] [nvarchar](150) NULL,
    [AccountNumber] [nvarchar](50) NULL,
 CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

创建存储过程代码:

CREATE PROCEDURE [dbo].[InsertAccount]
    @AccountName AS NVARCHAR(150) ,
    @ServiceAddress AS NVARCHAR(150) ,
    @AccountNumber AS NVARCHAR(50)
AS 
    INSERT  INTO dbo.accounts
            ( AccountName ,
              ServiceAddress ,
              AccountNumber
            )
            SELECT  @AccountName ,
                    @ServiceAddress ,
                    @AccountNumber

平面文件:将其命名为sample.csv

Account Name,Service Address,Account Number
JOE BLOW,ADDRESS X CITYX IL 61999,932F623Y52

我正在使用 WCF 连接到数据库

我正在使用存储过程

我为平面文件创建了一个架构

接收端口配置

发送端口配置

我创建了一条消息来接收平面文件

我创建了一条消息,将 XML 发送到 SQL

我删除了接收组件并分配了平面文件消息

我删除了发送组件并分配了存储过程消息

我删除了存储过程的接收响应组件

然后我放置了一个 Construct Message 组件来初始化 XML 文档并创建地图。

我将包部署到服务器,没有部署到 GAC, 然后我在GAC中手动注册了组件。

在服务器中:

我设置了所有的接收和发送端口:

发送端口

我配置应用程序

我启动了应用程序:

我放下文件,文件消失,我收到错误

我收到以下错误

The Messaging engine failed to process a message submitted by adapter:FILE Source URL:C:\Biztalk Test\Sales\SampleFile*.csv. Details:The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.

A message received by adapter "FILE" on receive location "ServerReceiveLocation" with URI "C:\Biztalk Test\Sales\SampleFile*.csv" is suspended. Error details: The published message could not be routed because no subscribers were found. This error occurs if the subscribing orchestration or send port has not been enlisted, or if some of the message properties necessary for subscription evaluation have not been promoted. Please use the Biztalk Administration console to troubleshoot this failure.

基本上,您的 Orchestrations 上的订阅与接收到的消息的上下文属性不匹配。

总是当您收到该错误时,您需要做的是查看暂停消息并查看它的外观并将其上下文属性与 BizTalk Administrator 中的订阅进行比较。

在你的情况下,问题似乎是你没有一个接收管道,它有一个平面文件分解器,上面指定了平面文件方案,它将把它转换成 XML 并发布它具有模式名称

的消息类型上下文属性

所以发生的事情是它将原始平面文件发布到没有消息类型的消息框,消息类型也是 Orchestration 订阅的内容,并且您没有特定的订阅规则来侦听消息从那个可以处理原始消息的端口。因此它不知道如何处理该消息并因上述错误而将其暂停。

您说:

"I deployed the package to the server, without deploying to the GAC, Then I registered the component in the GAC manually."

但是,这表明 BizTalk Server 的部署过程不正确。您应该 而不是 必须手动 GAC。此外,您没有在任何地方指明您使用 BizTalk Server 注册(导入)组件。

如果不导入,none 的工件对运行时可见,因此找不到架构。

如果你是 运行 本地(此时你应该是)只需 从 Visual Studio 部署,一切都将被注册和 GAG'自动。

如果您要部署到远程服务器(不能是您 DEV/TEST BizTalk 实例),那么您必须从您构建的计算机导出 .msi 或使用 BizTalk 部署框架创建部署包。