Reputation: 46440
If I need to build a specialized web app to be able to terminate messages processed by specific send ports, WMI is one option. Are there others? and are there pros/cons to each approach?
Upvotes: 3
Views: 1353
Reputation: 10274
You should be able to terminate messages programmatically by referencing the Microsoft.BizTalk.Operations.dll assembly. That will allow you to use the TerminateInstance
method of the BizTalkOperations Class, which allows you to reference a remote BizTalk instance (using this constructor) without enabling remote WMI administrative access.
You may also need to reference Microsoft.BizTalk.Pipeline.dll in Visual Studio to get IntelliSense to work.
The BizTalk SDK includes a sample app that you can review, as well, to see how to look up a message instance, which you'll need for the parameter to the TerminateInstance method: http://msdn.microsoft.com/en-us/library/gg163868
For example:
BizTalkOperations _operations = new BizTalkOperations()
IEnumerable messages = _operations.GetMessages();
foreach (BizTalkMessage msg in messages)
…
Upvotes: 5
Reputation: 1127
Have you considered the "/null" Send Port Adapter? This allows you to send messages to a "null" port, where they effectively disappear. Source code can be found here, although it hasn't been updated since BizTalk 2006 R2. If this isn't relevant to what you are trying to achieve, maybe some additional information regarding the use case would help.
Upvotes: 3