How do I delete a message in ActiveMQ using ZFW2?

38 views Asked by At

I am using ZendQueue component https://github.com/zendframework/ZendQueue.
After I read my messages, I try to delete them.
I am using the Queue object and the Activemq adapter.
I am connecting ok, as I am able to get the data I publish. The code is below:

$message_iterator = $queue->receive(50,50);
foreach($message_iterator as $MessageObject){
     do_somthing($MessageObject->body);
     $queue->getAdapter()->deleteMessage($MessageObject);
}

$queue is \ZendQueue\Queue
$MessageObject is \ZendQueue\Message
adapter is ZendQueue\Adapter\Activemq

0

There are 0 answers