File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
test/src/com/rabbitmq/tools Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,12 @@ public int getPeerPort() {
133133 public static List <ConnectionInfo > listConnections () throws IOException {
134134 String output = capture (rabbitmqctl ("list_connections pid peer_port" ).getInputStream ());
135135 String [] allLines = output .split ("\n " );
136- // this pattern must match rabbit_misc:pid_to_string/1
137- Pattern pattern = Pattern .compile ("(<.+\\ .\\ d+\\ .\\ d+\\ .\\ d+>)\\ s+(\\ d+)" );
138136
139137 ArrayList <ConnectionInfo > result = new ArrayList <ConnectionInfo >();
140138 for (String line : Arrays .copyOfRange (allLines , 1 , allLines .length - 1 )) {
141- Matcher m = pattern . matcher ( line );
142- m . find ( );
143- result .add (new ConnectionInfo (m . group ( 1 ) , Integer .valueOf (m . group ( 2 ) )));
139+ // line: <rabbit@mercurio.1.11491.0> 58713
140+ String [] columns = line . split ( " \t " );
141+ result .add (new ConnectionInfo (columns [ 0 ] , Integer .valueOf (columns [ 1 ] )));
144142 }
145143 return result ;
146144 }
You can’t perform that action at this time.
0 commit comments