.acquireMode(MessageAcquireMode.PRE_ACQUIRED));
ssn.messageSetFlowMode("echo-queue", MessageFlowMode.WINDOW);
ssn.messageFlow("echo-queue", MessageCreditUnit.MESSAGE, 0xFFFFFFFF);
ssn.messageFlow("echo-queue", MessageCreditUnit.BYTE, 0xFFFFFFFF);
UUIDGen gen = UUIDs.newGenerator();
long count = 0;
long lastTime = 0;
long start = System.currentTimeMillis();
while (opts.count == 0 || count < opts.count)
{
if (opts.window > 0 && (count % opts.window) == 0 && count > 0)
{
synchronized (echos)
{
while (echos[0] < (count/opts.window))
{
echos.wait();
}
}
}
if (opts.sample > 0 && (count % opts.sample) == 0)
{
long time = System.currentTimeMillis();
sample(opts, Column.LEFT, "NP", count, start, time, lastTime);
lastTime = time;
}
MessageProperties mp;
DeliveryProperties dp;
if (opts.message_cache)
{
mp = cached_mp;
dp = cached_dp;
}
else
{
mp = new MessageProperties();
dp = new DeliveryProperties();
dp.setRoutingKey("test-queue");
dp.setDeliveryMode
(opts.persistent ? MessageDeliveryMode.PERSISTENT : MessageDeliveryMode.NON_PERSISTENT);
}
if (opts.message_id)
{
mp.setMessageId(gen.generate());
}
if (opts.timestamp)
{
dp.setTimestamp(System.currentTimeMillis());