Skip to content

Commit b47a67e

Browse files
author
Emile Joubert
committed
Updated ApiOverview
1 parent d42c17b commit b47a67e

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

docs/wikipages/data.ApiOverview.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,19 @@ The following code connects to an AMQP broker:
119119

120120
@code java
121121
ConnectionFactory factory = new ConnectionFactory();
122-
IProtocol protocol = Protocols.FromEnvironment();
123-
IConnection conn = factory.CreateConnection(protocol, hostName, portNumber);
122+
factory.UserName = user;
123+
factory.Password = pass;
124+
factory.VirtualHost = vhost;
125+
factory.Protocol = Protocols.FromEnvironment();
126+
factory.HostName = hostName;
127+
factory.Port = AmqpTcpEndpoint.UseDefaultPort;
128+
IConnection conn = factory.CreateConnection();
124129

125130
The default parameters are:
126131
- username: [code "guest"]
127132
- password: [code "guest"]
128133
- virtual-host: [code "/"]
129134

130-
For control over the username, password and virtual-host supplied to
131-
the broker, modify the [code ConnectionFactory]'s [code
132-
ConnectionParameters] object before calling [code CreateConnection]:
133-
134-
@code java
135-
ConnectionParameters params = factory.Parameters;
136-
params.UserName = userName;
137-
params.Password = password;
138-
params.VirtualHost = virtualHost;
139-
IConnection conn = factory.CreateConnection(protocol, hostName, portNumber);
140-
141135
The IConnection interface can then be used to open a channel:
142136

143137
@code java

docs/wikipages/meta.ApiOverview.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
owner:
2-
timestamp: Thu, 24 Jan 2008 17:47:23 GMT
2+
timestamp: Thu, 01 Jul 2010 12:07:18 GMT
33
author:
44
editgroup:
55
viewgroup:

0 commit comments

Comments
 (0)