From 5f2ada92dfad039448fbf6e99a52b19712923317 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 30 Dec 2017 12:42:08 +0100 Subject: [PATCH] Adding prefetch=1 --- src/main/java/com/happyr/mq2php/queue/RabbitMqClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/happyr/mq2php/queue/RabbitMqClient.java b/src/main/java/com/happyr/mq2php/queue/RabbitMqClient.java index 026ab81..84967dc 100644 --- a/src/main/java/com/happyr/mq2php/queue/RabbitMqClient.java +++ b/src/main/java/com/happyr/mq2php/queue/RabbitMqClient.java @@ -37,6 +37,7 @@ public RabbitMqClient(String queueName, MessageConsumer mc) { channel = connection.createChannel(); channel.queueDeclare(queueName, true, false, false, null); + channel.basicQos(1); consumer = new QueueingConsumer(channel); channel.basicConsume(queueName, false, consumer);