We have a working (mostly) Service Broker setup. One problem is that we forgot to add a message type (EndTransmission
) to the contract so I created a new contract and added it to the two services.
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]) ;
I am still getting an error that EndTransmission is not part of the service contract. Do I need to do anything else? I can not SET a NEW BROKER because I am in an availability group.
I am trying to have two contracts on one services. As far as I can tell that is acceptable. I know I don't get an error when adding the second contract.
Your new contract should include all the messages from the the previous contract, and the new message. You only need to bind the contract to target service.
The error seems to indicate you still use the old contract in BEGIN DIALOG.
To give an example: say you had a contract that was using two message types:
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]) ;
and now you realize you need to add the EndTransmision message type. You would create a new contract that contains all three message types:
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]) ;
and now begin all new dialogs using the new contract.