Skip to content

Commit 2d23c4d

Browse files
author
Alexandru Scvortov
committed
add AMQP URI support to MCM
1 parent fbc9854 commit 2d23c4d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/src/com/rabbitmq/examples/MulticastMain.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public static void main(String[] args) {
8383
List<?> flags = lstArg(cmd, 'f');
8484
int frameMax = intArg(cmd, 'M', 0);
8585
int heartbeat = intArg(cmd, 'b', 0);
86+
String uri = strArg(cmd, 'u', null);
8687

8788
boolean exclusive = "".equals(queueName);
8889
boolean autoDelete = !exclusive;
@@ -91,8 +92,12 @@ public static void main(String[] args) {
9192
String id = UUID.randomUUID().toString();
9293
Stats stats = new Stats(1000L * samplingInterval);
9394
ConnectionFactory factory = new ConnectionFactory();
94-
factory.setHost(hostName);
95-
factory.setPort(portNumber);
95+
if (uri != null) {
96+
factory.setUri(uri);
97+
} else {
98+
factory.setHost(hostName);
99+
factory.setPort(portNumber);
100+
}
96101
factory.setRequestedFrameMax(frameMax);
97102
factory.setRequestedHeartbeat(heartbeat);
98103

@@ -197,6 +202,7 @@ private static Options getOptions() {
197202
options.addOption(flag);
198203
options.addOption(new Option("M", "framemax", true, "frame max"));
199204
options.addOption(new Option("b", "heartbeat", true, "heartbeat interval"));
205+
options.addOption(new Option("u", "uri", true, "AMQP URI"));
200206
return options;
201207
}
202208

0 commit comments

Comments
 (0)