0

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

Joe Watkins
  • 17,032
  • 5
  • 41
  • 62
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
  • 1
    .. and your error/problem/error log/debug output/activemq log/etc is what? – Petter Nordlander Feb 10 '17 at 07:14
  • There is nothing in the logs. After long research I found out that to delete a message u need to use the messagwe id AND be on the same session. For It was disconnecting between read and delete. Once that was fixed, all went well. – Itay Moav -Malimovka Feb 11 '17 at 00:16

0 Answers0