@@ -87,6 +87,10 @@ static String rabbitmqStreamsCommand() {
8787 return rabbitmqctl .substring (0 , lastIndex ) + "rabbitmq-streams" ;
8888 }
8989
90+ static ProcessState rabbitmqctl (String command , String node ) {
91+ return executeCommand (replaceContainerId (rabbitmqctlCommand (), node ) + " " + command );
92+ }
93+
9094 static ProcessState rabbitmqctl (String command ) {
9195 return executeCommand (rabbitmqctlCommand () + " " + command );
9296 }
@@ -227,15 +231,20 @@ static void deleteQuorumQueueMember(String queue, String node) {
227231 }
228232
229233 static String quorumStatus (String queue , String node ) {
234+ String cmd = replaceContainerId (rabbitmqQueuesCommand (), node );
235+ return executeCommand (cmd + " quorum_status --formatter erlang " + queue ).output ();
236+ }
237+
238+ private static String replaceContainerId (String cmd , String node ) {
230239 String containerId = DOCKER_NODES_TO_CONTAINERS .get (node );
231240 Assert .notNull (containerId , "Container ID for node " + node );
232- String cmd = rabbitmqQueuesCommand ();
233241 for (String value : DOCKER_NODES_TO_CONTAINERS .values ()) {
234242 if (cmd .contains ("docker exec " + value )) {
235243 cmd = cmd .replace ("docker exec " + value , "docker exec " + containerId );
244+ break ;
236245 }
237246 }
238- return executeCommand ( cmd + " quorum_status --formatter erlang " + queue ). output () ;
247+ return cmd ;
239248 }
240249
241250 static void addStreamMember (String stream , String node ) {
0 commit comments