Skip to content

Commit 43da301

Browse files
committed
Allow passing hostname to publisherconfirms test app.
1 parent 45f69fe commit 43da301

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

projects/Applications/PublisherConfirms/PublisherConfirms.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,24 @@
5555
Persistent = true
5656
};
5757

58+
string hostname = "localhost";
59+
if (args.Length > 0)
60+
{
61+
if (false == string.IsNullOrWhiteSpace(args[0]))
62+
{
63+
hostname = args[0];
64+
}
65+
}
66+
5867
#pragma warning disable CS8321 // Local function is declared but never used
5968

6069
await PublishMessagesIndividuallyAsync();
6170
await PublishMessagesInBatchAsync();
6271
await HandlePublishConfirmsAsynchronously();
6372

64-
static Task<IConnection> CreateConnectionAsync()
73+
Task<IConnection> CreateConnectionAsync()
6574
{
66-
var factory = new ConnectionFactory { HostName = "localhost" };
75+
var factory = new ConnectionFactory { HostName = hostname };
6776
return factory.CreateConnectionAsync();
6877
}
6978

0 commit comments

Comments
 (0)