forked from rabbitmq/rabbitmq-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rabbitmq#5881 from rabbitmq/list-amqp10-connections
List amqp10 connections
- Loading branch information
Showing
7 changed files
with
187 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
deps/rabbitmq_amqp1_0/test/system_SUITE_data/console/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Amqp; | ||
using Amqp.Framing; | ||
|
||
// See https://aka.ms/new-console-template for more information | ||
Console.WriteLine("Sending 10 messages to amqp10-queue. Press a button to terminate"); | ||
|
||
// Create the AMQP connection string | ||
var connectionString = $"amqp://guest:guest@localhost:5672/%2F"; | ||
|
||
// Create the AMQP connection | ||
var connection = new Connection(new Address(connectionString)); | ||
|
||
// Create the AMQP session | ||
var amqpSession = new Session(connection); | ||
|
||
// Give a name to the sender | ||
var senderSubscriptionId = "rabbitmq.amqp.sender"; | ||
|
||
// Name of the topic you will be sending messages (Name of the Queue) | ||
var topic = "amqp10-queue"; | ||
|
||
// Create the AMQP sender | ||
var sender = new SenderLink(amqpSession, senderSubscriptionId, topic); | ||
|
||
for (var i = 0; i < 10; i++) | ||
{ | ||
// Create message | ||
var message = new Message($"Received message {i}"); | ||
|
||
// Add a meesage id | ||
message.Properties = new Properties() { MessageId = Guid.NewGuid().ToString() }; | ||
|
||
// Add some message properties | ||
message.ApplicationProperties = new ApplicationProperties(); | ||
message.ApplicationProperties["Message.Type.FullName"] = typeof(string).FullName; | ||
|
||
// Send message | ||
sender.Send(message); | ||
|
||
Task.Delay(2000).Wait(); | ||
} | ||
|
||
// Wait for a key to close the program | ||
Console.Read(); |
11 changes: 11 additions & 0 deletions
11
deps/rabbitmq_amqp1_0/test/system_SUITE_data/console/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Console application to test AMQP 1.0 | ||
|
||
This is a basic .NetCore console application which uses *AMQP 1.0* .Net **AMQPNetLite** client library. | ||
|
||
Usage: | ||
``` | ||
dotnet run | ||
``` | ||
|
||
It sends 10 messages and it waits for key-stroke to terminate which is very convenient | ||
when we need to create AMQP 1.0 connections. |
13 changes: 13 additions & 0 deletions
13
deps/rabbitmq_amqp1_0/test/system_SUITE_data/console/standalone.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="AMQPNetLite" Version="2.4.5" /> | ||
</ItemGroup> | ||
|
||
</Project> |