Skip to content

Commit 078480b

Browse files
Copilotrkttu
andcommitted
Add documentation for remote queue path formats in README
Co-authored-by: rkttu <1297346+rkttu@users.noreply.github.com>
1 parent f16d6dd commit 078480b

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,64 @@ The source code for this package is excerpted from the .NET Framework reference
1313

1414
This source code is based on Microsoft's Reference Source, but may contain differences from the original. Bug fixes have been applied in the public interest based on community-reported issues. If Microsoft officially releases an MSMQ client package for .NET Core/.NET 5+, that official package should take priority over this experimental package. Users are encouraged to migrate to the official package when it becomes available.
1515

16+
## Queue Path Formats
17+
18+
The `MessageQueue` constructor accepts various path formats. Below are common formats you can use:
19+
20+
### Local Queue Paths
21+
22+
```csharp
23+
// Local private queue
24+
var queue = new MessageQueue(@".\Private$\MyQueue");
25+
26+
// Local private queue using machine name
27+
var queue = new MessageQueue(@"MachineName\Private$\MyQueue");
28+
```
29+
30+
### Remote Queue Paths (Format Names)
31+
32+
To connect to remote queues, use the direct format name syntax:
33+
34+
```csharp
35+
// Using TCP (recommended for remote queues)
36+
var queue = new MessageQueue(@"FormatName:Direct=TCP:192.168.1.100\Private$\MyQueue");
37+
38+
// Using OS (uses Windows networking)
39+
var queue = new MessageQueue(@"FormatName:Direct=OS:RemoteMachineName\Private$\MyQueue");
40+
41+
// Using HTTP (requires MSMQ HTTP support)
42+
var queue = new MessageQueue(@"FormatName:Direct=HTTP://hostname/msmq/Private$/MyQueue");
43+
44+
// Using HTTPS
45+
var queue = new MessageQueue(@"FormatName:Direct=HTTPS://hostname/msmq/Private$/MyQueue");
46+
```
47+
48+
### Format Name Syntax Reference
49+
50+
| Protocol | Format | Example |
51+
|----------|--------|---------|
52+
| TCP | `FormatName:Direct=TCP:address\queue` | `FormatName:Direct=TCP:192.168.1.100\Private$\MyQueue` |
53+
| OS | `FormatName:Direct=OS:machine\queue` | `FormatName:Direct=OS:Server01\Private$\MyQueue` |
54+
| HTTP | `FormatName:Direct=HTTP://host/msmq/queue` | `FormatName:Direct=HTTP://server/msmq/Private$/MyQueue` |
55+
| HTTPS | `FormatName:Direct=HTTPS://host/msmq/queue` | `FormatName:Direct=HTTPS://server/msmq/Private$/MyQueue` |
56+
57+
### Public Queues
58+
59+
```csharp
60+
// Local public queue
61+
var queue = new MessageQueue(@"MachineName\MyPublicQueue");
62+
63+
// Remote public queue using format name
64+
var queue = new MessageQueue(@"FormatName:Direct=TCP:192.168.1.100\MyPublicQueue");
65+
```
66+
67+
### Important Notes
68+
69+
- When using TCP format, use the IP address or hostname directly after `TCP:` without brackets
70+
- For private queues, always include `Private$` in the path
71+
- Remote queue access requires appropriate firewall rules and MSMQ configuration on the remote machine
72+
- The `Direct` format bypasses Active Directory lookup, making it suitable for workgroup environments
73+
1674
## Release Note
1775

1876
### v1.2.0 (2025-11-30)

0 commit comments

Comments
 (0)