Skip to content

Commit

Permalink
Allow passing hostname to publisherconfirms test app.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Oct 23, 2024
1 parent 45f69fe commit 43da301
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions projects/Applications/PublisherConfirms/PublisherConfirms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,24 @@
Persistent = true
};

string hostname = "localhost";
if (args.Length > 0)
{
if (false == string.IsNullOrWhiteSpace(args[0]))
{
hostname = args[0];
}
}

#pragma warning disable CS8321 // Local function is declared but never used

await PublishMessagesIndividuallyAsync();
await PublishMessagesInBatchAsync();
await HandlePublishConfirmsAsynchronously();

static Task<IConnection> CreateConnectionAsync()
Task<IConnection> CreateConnectionAsync()
{
var factory = new ConnectionFactory { HostName = "localhost" };
var factory = new ConnectionFactory { HostName = hostname };
return factory.CreateConnectionAsync();
}

Expand Down

0 comments on commit 43da301

Please sign in to comment.