int rateLimit = optArg("rateLimit", args, 1, SEND_RATE);
int messageCount = optArg("messageCount", args, 2, LATENCY_MESSAGE_COUNT);
boolean sendCompletion = optArg("sendCompletion", args, 3, false);
int commitEvery = optArg("commitEvery", args, 4, -1);
boolean sendLatencyInfo = optArg("sendLatencyInfo", args, 5, true);
final Connection conn = new ConnectionFactory(){{setUri(uri);}}.newConnection();
//if (commitEvery > 0) { conn.getSocket().setTcpNoDelay(true); }
System.out.println("Channel 0 fully open.");
new ProducerMain(conn, rateLimit, messageCount, sendCompletion, commitEvery, sendLatencyInfo).run();
} catch (Exception e) {
System.err.println("Main thread caught exception: " + e);