[rabbitmq-discuss] RabbitMQ perfomance testing & troubles
Andrew V. Statsenko
alter at tcontest.ru
Wed Apr 16 14:17:30 BST 2008
В Срд, 16/04/2008 в 13:48 +0100, Matthias Radestock пишет:
> Andrew,
> >> - The consumer explicitly acknowledges each message. Would
> >> bulk-acknowledgment or auto-acknowledgment be an option?
> >
> > OK, I was delete the acknowledges each message code
> >
> > - // channel.basicAck(envelope.getDeliveryTag(), false);
>
> That's not sufficient. You need to change channel.basicConsume(...)
> invocation to enable auto-ack. Otherwise your above change will result
> in the server hanging on to all messages.
Yes, I was look to the javadoc:
basicConsume(int ticket, java.lang.String queue, boolean noAck,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with a
server-generated consumerTag.
and the consumer code I running in latest reported here test is:
QueueingConsumer consumer = new QueueingConsumer(channel);
channel.basicConsume(ticket, topic, true, consumer);
Thread.sleep(5000);
for( int i = 0; i < MSG_COUNT; i++) {
QueueingConsumer.Delivery delivery = consumer.nextDelivery();
Envelope envelope = delivery.getEnvelope();
System.out.println("CLIENT_CONSUMER_THREAD_ID: " + this.THREAD_ID
+ " TIME: " + System.currentTimeMillis() + " " + new
String(delivery.getBody()) ) ;
}
Is this invocation "channel.basicConsume(ticket, topic, true,
consumer);" enable auto-ack ?
WBR,
Alter.
More information about the rabbitmq-discuss
mailing list