in amazon-mq-client/src/main/java/com/aws/sample/amazonmq/AmazonMqClient.java [139:164]
private static CommandLine parseAndValidateCommandLineArguments(String[] args) throws ParseException {
Options options = new Options();
options.addOption("help", false, "Print the help message.");
options.addOption("url", true, "The broker connection url.");
options.addOption("user", true, "The user to connect to the broker.");
options.addOption("password", true, "The password for the user.");
options.addOption("mode", true, "Whether to act as 'sender' or 'receiver'");
options.addOption("type", true, "Whether to use a queue or a topic.");
options.addOption("destination", true, "The name of the queue or topic");
options.addOption("name", true, "The name of the sender");
options.addOption("interval", true, "The interval in msec at which messages are generated. Default 1000");
options.addOption("notPersistent", false, "Send messages in non-persistent mode");
options.addOption("ttl", true, "The time to live value for the message.");
CommandLineParser parser = new DefaultParser();
CommandLine cmd = parser.parse(options, args);
if (cmd.hasOption("help")) {
printUsage(options);
}
if (!(cmd.hasOption("url") && cmd.hasOption("type") && cmd.hasOption("mode") && cmd.hasOption("destination"))) {
printUsage(options);
}
return cmd;
}