Rabbit prefetch

Question!

I use spring amqp with rabbitmq. I want get one message without prefetch. I configured with

      SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
    container.setConnectionFactory(rabbitConnectionFactory());
    container.setQueueNames(
            ProjectConfigs.getInstance().get_RABBIT_TASK_QUEUE()
    );
    container.setMessageListener(taskListener());
    container.setConcurrentConsumers(1);
    container.setPrefetchCount(1);
    container.setTxSize(1);
    return container;

How to disable prefetch and get only one message/



This video can help you solving your question :)
By: admin