title | summary | reviewed | component | redirects | related | ||
---|---|---|---|---|---|---|---|
MSMQ Transport Scripting |
Sample code and scripts to facilitate deployment and operational actions against MSMQ. |
2022-10-07 |
MsmqTransport |
|
|
This article contains code and scripts to facilitate deployment and operational actions with MSMQ.
These examples use the System.Messaging and System.Transactions assemblies.
Warning
The Systems.Messaging
namespace is not available in .NET Core.
Note
When using the C# code samples, be sure to add the proper includes for both the System.Messaging
and System.Transactions
assemblies in the program that's using these functions. When using the PowerShell scripts, include these assemblies by calling Add-Type
in the script.
Queue creation can be done for a specific endpoint or queues shared between multiple endpoints.
Note
It may be necessary to script the creation of extra instance-specific queues. For example when using callbacks or scale-out based on sender-side distribution.
See also: Queue Permissions
snippet: msmq-create-queues
snippet: msmq-create-queues-powershell
To create all queues for a given endpoint name.
snippet: msmq-create-queues-for-endpoint
snippet: msmq-create-queues-for-endpoint-powershell
snippet: msmq-create-queues-endpoint-usage
snippet: msmq-create-queues-endpoint-usage-powershell
snippet: msmq-create-queues-shared-usage
snippet: msmq-create-queues-shared-usage-powershell
snippet: msmq-delete-queues
snippet: msmq-delete-queues-powershell
snippet: msmq-delete-queues-for-endpoint
snippet: msmq-delete-queues-endpoint-usage
snippet: msmq-delete-queues-shared-usage