Hi, this's an SDK-using question. I am now using com.rabbitmq:amqp-client:5.14.2 in my project.
Which consume messages like this:
public void listenAndCalculate() {
Channel channel = getChannel();
try {
channel.basicConsume(PARAM_QUEUE, false, new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) {
// do something...
}
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
I found that the message would be only processed serially but not concurrently. I can find nothing to do but in spring, well in Spring-AMQP it provided a way like new SimpleRabbitListenerContainerFactory().setConcurrentConsumers(30);
But the problem is I don't want to use Spring things in my project, is there a way to process batch messages concurrently in one consumer?
Hi, this's an SDK-using question. I am now using
com.rabbitmq:amqp-client:5.14.2in my project.Which consume messages like this:
I found that the message would be only processed serially but not concurrently. I can find nothing to do but in spring, well in
Spring-AMQPit provided a way likenew SimpleRabbitListenerContainerFactory().setConcurrentConsumers(30);But the problem is I don't want to use Spring things in my project, is there a way to process batch messages concurrently in one consumer?