在 Service Broker 中向服务添加合同后
After Adding a Contract to a Service in Service Broker
我们有一个有效的(大部分)Service Broker 设置。一个问题是我们忘记在合约中添加消息类型(EndTransmission
),所以我创建了一个新合约并将其添加到两个服务中。
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]
([http://bob.us/Locations/MessageTypes/Resource/EndTransmission] SENT BY ANY)
ALTER SERVICE [//Locations/Here/Send/VolatileDataReceiveService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]) ;
ALTER SERVICE [//Locations/Here/Send/VolatileDataSendService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]) ;
我仍然收到 EndTransmission 不是服务合同的一部分的错误。我还需要做其他事情吗?我无法设置新代理,因为我在可用性组中。
我想在一项服务上签订两份合同。据我所知这是可以接受的。我知道我在添加第二个合同时不会出错。
您的新合同应包括前一份合同中的所有消息,和 新消息。你只需要将合约绑定到目标服务即可。
该错误似乎表明您在 BEGIN DIALOG 中仍在使用旧合同。
举个例子:假设你有一个使用两种消息类型的合同:
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData1]
([http://bob.us/Locations/MessageTypes/Resource/Request] SENT BY INITIATOR,
[http://bob.us/Locations/MessageTypes/Resource/Response] SENT BY TARGET);
CREATE SERVICE [//Locations/Here/Send/VolatileDataReceiveService] ON [...]
([http://bob.us/Locations/Contracts/VolatileData1]) ;
现在您意识到需要添加 EndTransmision 消息类型。您将创建一个包含所有三种消息类型的新合同:
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData2]
([http://bob.us/Locations/MessageTypes/Resource/Request] SENT BY INITIATOR,
[http://bob.us/Locations/MessageTypes/Resource/Response] SENT BY TARGET,
[http://bob.us/Locations/MessageTypes/Resource/EndTransmission] SENT BY ANY);
ALTER SERVICE [//Locations/Here/Send/VolatileDataReceiveService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData2]) ;
现在使用新合同开始所有新对话。
我们有一个有效的(大部分)Service Broker 设置。一个问题是我们忘记在合约中添加消息类型(EndTransmission
),所以我创建了一个新合约并将其添加到两个服务中。
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]
([http://bob.us/Locations/MessageTypes/Resource/EndTransmission] SENT BY ANY)
ALTER SERVICE [//Locations/Here/Send/VolatileDataReceiveService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]) ;
ALTER SERVICE [//Locations/Here/Send/VolatileDataSendService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData3]) ;
我仍然收到 EndTransmission 不是服务合同的一部分的错误。我还需要做其他事情吗?我无法设置新代理,因为我在可用性组中。
我想在一项服务上签订两份合同。据我所知这是可以接受的。我知道我在添加第二个合同时不会出错。
您的新合同应包括前一份合同中的所有消息,和 新消息。你只需要将合约绑定到目标服务即可。
该错误似乎表明您在 BEGIN DIALOG 中仍在使用旧合同。
举个例子:假设你有一个使用两种消息类型的合同:
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData1]
([http://bob.us/Locations/MessageTypes/Resource/Request] SENT BY INITIATOR,
[http://bob.us/Locations/MessageTypes/Resource/Response] SENT BY TARGET);
CREATE SERVICE [//Locations/Here/Send/VolatileDataReceiveService] ON [...]
([http://bob.us/Locations/Contracts/VolatileData1]) ;
现在您意识到需要添加 EndTransmision 消息类型。您将创建一个包含所有三种消息类型的新合同:
CREATE CONTRACT [http://bob.us/Locations/Contracts/VolatileData2]
([http://bob.us/Locations/MessageTypes/Resource/Request] SENT BY INITIATOR,
[http://bob.us/Locations/MessageTypes/Resource/Response] SENT BY TARGET,
[http://bob.us/Locations/MessageTypes/Resource/EndTransmission] SENT BY ANY);
ALTER SERVICE [//Locations/Here/Send/VolatileDataReceiveService]
(ADD CONTRACT [http://bob.us/Locations/Contracts/VolatileData2]) ;
现在使用新合同开始所有新对话。