<HTML>
<HEAD>
<TITLE>Performance question</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I have a one producer, one consumer queue running locally for a performance test. In terms of just server and client configuration, what is the best way to increase performance. For a simple queue publisher and consumer, I’m getting about 10k a second for simple byte messages. <BR>
<BR>
Here is some of the code:<BR>
<BR>
Publisher:<BR>
channel.exchangeDeclare("exchangename", "direct");
channel.queueDeclare("queuename");
channel
.queueBind("queuename", "exchangename",
"routingKey");
byte[] messageBodyBytes = new byte[0];
int count = 0;
long start = System.currentTimeMillis();
String name = Thread.currentThread().getName();
for (int i = 0; i < 100000; i++) {
channel.basicPublish("exchangename", "routingKey",
null, messageBodyBytes);
count++;
if ((System.currentTimeMillis() - start) > 1000) {
System.out.println(name + "-" + count);
count = 0;
start = System.currentTimeMillis();
}
}<BR>
<BR>
<BR>
Consumer:<BR>
channel.basicConsume("queuename", false, new DefaultConsumer(channel) {
int count = 0;
long start = System.currentTimeMillis();
@Override
public void handleDelivery(String consumerTag, Envelope envelope,
BasicProperties properties, byte[] body) throws IOException {
count++;
if ((System.currentTimeMillis() - start) > 1000) {
System.out.println(count);
count = 0;
start = System.currentTimeMillis();
}
this.getChannel().basicAck(envelope.getDeliveryTag(), false);
}
});<BR>
<BR>
Is there some way I can increase the performance? From the tests I have seen online, I hear numbers of millions of messages a second. <BR>
<BR>
Roshan</SPAN></FONT>
</BODY>
</HTML>