@@ -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