|
42 | 42 | import org.apache.commons.cli.ParseException; |
43 | 43 |
|
44 | 44 | import com.rabbitmq.client.ConnectionFactory; |
| 45 | +import com.rabbitmq.client.DefaultSaslConfig; |
45 | 46 | import org.slf4j.Logger; |
46 | 47 | import org.slf4j.LoggerFactory; |
47 | 48 |
|
@@ -109,6 +110,7 @@ public static void main(String [] args, PerfTestOptions perfTestOptions) { |
109 | 110 | boolean legacyMetrics = cmd.hasOption('l'); |
110 | 111 | boolean autoDelete = boolArg(cmd, "ad", true); |
111 | 112 | boolean useMillis = cmd.hasOption("ms"); |
| 113 | + boolean saslExternal = cmd.hasOption("se"); |
112 | 114 | String queueArgs = strArg(cmd, "qa", null); |
113 | 115 | int consumerLatencyInMicroseconds = intArg(cmd, 'L', 0); |
114 | 116 | int heartbeatSenderThreads = intArg(cmd, "hst", -1); |
@@ -157,11 +159,13 @@ public static void main(String [] args, PerfTestOptions perfTestOptions) { |
157 | 159 | SSLContext sslContext = perfTestOptions.skipSslContextConfiguration ? null : |
158 | 160 | getSslContextIfNecessary(cmd, System.getProperties()); |
159 | 161 |
|
160 | | - |
161 | 162 | ConnectionFactory factory = new ConnectionFactory(); |
162 | 163 | if (sslContext != null) { |
163 | 164 | factory.useSslProtocol(sslContext); |
164 | 165 | } |
| 166 | + if (saslExternal) { |
| 167 | + factory.setSaslConfig(DefaultSaslConfig.EXTERNAL); |
| 168 | + } |
165 | 169 | factory.setShutdownTimeout(0); // So we still shut down even with slow consumers |
166 | 170 | factory.setUri(uris.get(0)); |
167 | 171 | factory.setRequestedFrameMax(frameMax); |
@@ -389,7 +393,10 @@ private static Options getOptions() { |
389 | 393 | options.addOption(new Option("qa", "queue-args", true, "queue arguments as key/pair values, separated by commas, " |
390 | 394 | + "e.g. x-max-length=10")); |
391 | 395 | options.addOption(new Option("L", "consumer-latency", true, "consumer latency in microseconds")); |
392 | | - options.addOption(new Option("udsc", "use-default-ssl-context", false,"use JVM default SSL context")); |
| 396 | + |
| 397 | + options.addOption(new Option("udsc", "use-default-ssl-context", false, "use JVM default SSL context")); |
| 398 | + options.addOption(new Option("se", "sasl-external", false, "use SASL EXTERNAL authentication, default is false. " + |
| 399 | + "Set to true if using client certificate authentication with the rabbitmq_auth_mechanism_ssl plugin.")); |
393 | 400 |
|
394 | 401 | options.addOption(new Option("v", "version", false,"print version information")); |
395 | 402 |
|
|
0 commit comments