You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet-amqp/README.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Here you can find C# examples from the [RabbitMQ tutorials](https://www.rabbitmq
4
4
5
5
You need a RabbitMQ node running locally. The client requires **RabbitMQ 4.0 or newer** with AMQP 1.0 on port **5672**. The examples use the default `guest` user. See the [AMQP 1.0 client libraries overview](https://www.rabbitmq.com/client-libraries/amqp-client-libraries) and [AMQP in RabbitMQ](https://www.rabbitmq.com/docs/amqp).
6
6
7
-
There is a solution file for Visual Studio 2022 (`dotnet-amqp.sln`). From this directory, use `dotnet run --project` as below.
7
+
There is a solution file for Visual Studio 2022 (`dotnet-amqp.sln`). From this directory, use `dotnet run -f net8.0 --project` as below.
8
8
9
9
End-to-end smoke tests (broker on `localhost`, management plugin used to reset `hello` / `task_queue` when needed):
10
10
@@ -14,7 +14,7 @@ End-to-end smoke tests (broker on `localhost`, management plugin used to reset `
-[.NET 8 or .NET 10 SDK](https://dotnet.microsoft.com/download) (projects target `net8.0` and `net10.0`; use `-f net10.0` instead of `-f net8.0` in the commands below if you prefer)
18
18
- NuGet package: `RabbitMQ.AMQP.Client` (see each `.csproj`; restore runs automatically with `dotnet run` or `dotnet build`)
19
19
20
20
## Code
@@ -24,71 +24,71 @@ Run each example from the `dotnet-amqp` directory.
24
24
#### Tutorial one: "Hello World!"
25
25
26
26
```bash
27
-
dotnet run --project Receive/Receive.csproj
28
-
dotnet run --project Send/Send.csproj
27
+
dotnet run -f net8.0 --project Receive/Receive.csproj
28
+
dotnet run -f net8.0 --project Send/Send.csproj
29
29
```
30
30
31
31
#### Tutorial two: Work Queues
32
32
33
33
```bash
34
-
dotnet run --project Worker/Worker.csproj
35
-
dotnet run --project Worker/Worker.csproj
36
-
dotnet run --project NewTask/NewTask.csproj "First Message"
37
-
dotnet run --project NewTask/NewTask.csproj "Second Message"
38
-
dotnet run --project NewTask/NewTask.csproj "Third Message"
39
-
dotnet run --project NewTask/NewTask.csproj "Fourth Message"
40
-
dotnet run --project NewTask/NewTask.csproj "Fifth Message"
34
+
dotnet run -f net8.0 --project Worker/Worker.csproj
35
+
dotnet run -f net8.0 --project Worker/Worker.csproj
36
+
dotnet run -f net8.0 --project NewTask/NewTask.csproj "First Message"
37
+
dotnet run -f net8.0 --project NewTask/NewTask.csproj "Second Message"
38
+
dotnet run -f net8.0 --project NewTask/NewTask.csproj "Third Message"
39
+
dotnet run -f net8.0 --project NewTask/NewTask.csproj "Fourth Message"
40
+
dotnet run -f net8.0 --project NewTask/NewTask.csproj "Fifth Message"
41
41
```
42
42
43
43
#### Tutorial three: Publish/Subscribe
44
44
45
45
```bash
46
-
dotnet run --project ReceiveLogs/ReceiveLogs.csproj
47
-
dotnet run --project ReceiveLogs/ReceiveLogs.csproj
48
-
dotnet run --project EmitLog/EmitLog.csproj
46
+
dotnet run -f net8.0 --project ReceiveLogs/ReceiveLogs.csproj
47
+
dotnet run -f net8.0 --project ReceiveLogs/ReceiveLogs.csproj
48
+
dotnet run -f net8.0 --project EmitLog/EmitLog.csproj
49
49
```
50
50
51
51
#### Tutorial four: Routing
52
52
53
53
```bash
54
-
dotnet run --project ReceiveLogsDirect/ReceiveLogsDirect.csproj warning error
55
-
dotnet run --project ReceiveLogsDirect/ReceiveLogsDirect.csproj info warning error
56
-
dotnet run --project EmitLogDirect/EmitLogDirect.csproj info "Run. Run. Or it will explode."
57
-
dotnet run --project EmitLogDirect/EmitLogDirect.csproj warning "Run. Run. Or it will explode."
58
-
dotnet run --project EmitLogDirect/EmitLogDirect.csproj error "Run. Run. Or it will explode."
54
+
dotnet run -f net8.0 --project ReceiveLogsDirect/ReceiveLogsDirect.csproj warning error
55
+
dotnet run -f net8.0 --project ReceiveLogsDirect/ReceiveLogsDirect.csproj info warning error
56
+
dotnet run -f net8.0 --project EmitLogDirect/EmitLogDirect.csproj info "Run. Run. Or it will explode."
57
+
dotnet run -f net8.0 --project EmitLogDirect/EmitLogDirect.csproj warning "Run. Run. Or it will explode."
58
+
dotnet run -f net8.0 --project EmitLogDirect/EmitLogDirect.csproj error "Run. Run. Or it will explode."
59
59
```
60
60
61
61
#### Tutorial five: Topics
62
62
63
63
```bash
64
-
dotnet run --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "#"
65
-
dotnet run --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "kern.*"
66
-
dotnet run --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "*.critical"
67
-
dotnet run --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "kern.*""*.critical"
68
-
dotnet run --project EmitLogTopic/EmitLogTopic.csproj kern.critical "A critical kernel error"
64
+
dotnet run -f net8.0 --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "#"
65
+
dotnet run -f net8.0 --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "kern.*"
66
+
dotnet run -f net8.0 --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "*.critical"
67
+
dotnet run -f net8.0 --project ReceiveLogsTopic/ReceiveLogsTopic.csproj "kern.*""*.critical"
68
+
dotnet run -f net8.0 --project EmitLogTopic/EmitLogTopic.csproj kern.critical "A critical kernel error"
69
69
```
70
70
71
71
#### Tutorial six: RPC
72
72
73
73
```bash
74
-
dotnet run --project RPCServer/RPCServer.csproj
75
-
dotnet run --project RPCClient/RPCClient.csproj
74
+
dotnet run -f net8.0 --project RPCServer/RPCServer.csproj
75
+
dotnet run -f net8.0 --project RPCClient/RPCClient.csproj
76
76
```
77
77
78
78
The client requests Fibonacci numbers for `0` through `31`, matching the Java AMQP 1.0 tutorial client.
dotnet run --project PublisherConfirms/PublisherConfirms.csproj
83
+
dotnet run -f net8.0 --project PublisherConfirms/PublisherConfirms.csproj
84
84
```
85
85
86
86
#### AMQP 1.0 Direct Reply-To RPC
87
87
88
88
On RabbitMQ **4.2 and newer**, the .NET `Requester` uses [Direct Reply-To](https://www.rabbitmq.com/docs/direct-reply-to) when no explicit reply queue is set (see the client’s requester implementation). Older brokers fall back to a temporary reply queue.
89
89
90
90
```bash
91
-
dotnet run --project RpcAmqp10/RpcAmqp10.csproj
91
+
dotnet run -f net8.0 --project RpcAmqp10/RpcAmqp10.csproj
92
92
```
93
93
94
94
This sample runs a responder and a requester in one process; press CTRL+C to exit.
0 commit comments