I am working on an application that uses Micronaut and needs to consume message from a RabbitMQ queue. The matter is that the queue can provide a lot of messages so I would like to have a parameterized number of instance of the consumer.
For example the following code auto generate one instance of the consumer :
@RabbitListener
public class TestConsumer {
@Queue("TestQueue")
public void handleMessage(String message) {
// some treatment
}
}
Is there a way to tell micronaut to instantiate more than one instance ?