Skip to content

Commit 13aa208

Browse files
author
David R. MacIver
committed
update usage example for connectionFactory
1 parent 11bba62 commit 13aa208

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,18 @@ namespace RabbitMQ.Client
7272
/// A simple example of connecting to a broker:
7373
///</para>
7474
///<example><code>
75-
/// ConnectionFactory factory = new ConnectionFactory();
7675
/// //
77-
/// // The next three lines are optional:
78-
/// factory.Parameters.UserName = AMQPParameters.DefaultUser;
79-
/// factory.Parameters.Password = AMQPParameters.DefaultPass;
80-
/// factory.Parameters.VirtualHost = AMQPParameters.DefaultVHost;
8176
/// //
8277
/// IProtocol protocol = Protocols.DefaultProtocol;
83-
/// IConnection conn = factory.CreateConnection(protocol, hostName, portNumber);
78+
/// ConnectionFactory factory = new ConnectionFactory();
79+
/// // The next five lines are optional:
80+
/// AMQPParameters params = new AMQPParameters();
81+
/// params.UserName = AMQPParameters.DefaultUser;
82+
/// params.Password = AMQPParameters.DefaultPass;
83+
/// params.VirtualHost = AMQPParameters.DefaultVHost;
84+
/// factory.Parameters = new ConnectionParameters[]{ new ConnectionParameters(params) };
85+
/// //
86+
/// IConnection conn = factory.CreateConnection();
8487
/// //
8588
/// IModel ch = conn.CreateModel();
8689
/// //

0 commit comments

Comments
 (0)