Reputation: 31
Hy, i use an Apollo Activemq Broker and Stomp.
I wrote two methods one for sending the message to the broker and one for reading the message from the queue.
When i send one message to the borker and then i read it, everything is ok, i can read and acknowledge the message,my problem appear when i run multiple times the sending message and i have many message in the queue, when i try to read and acknowledge the message every time i receive only the first message from the queue.
Also if i run a loop "
while ($con->HasFrame) {
$msg = $con->readFrame();
$con->ack($msg);
}
everything is ok, i can read and acknowledge all the message from the queue.
UPDATE : ActiveMQ not removing messages from a queue when the ack is received from PHP. Ack return true but the message is still there in the queue.
UPDATE : My problem seems to be "prefetchSize" which default is 1000, i want to set this to 1, i use stomp to interact with the broker, please give me a hint were should i change that value from 1000 to 1.
Upvotes: 0
Views: 490
Reputation: 2109
Try adding activemq.prefetchSize:1
header in SUBSCRIBE frame.
Upvotes: 0