php - How to read a message only once from a queue -


i using activemq store queue of messages.
using pecl stomp extension connect it. publishing queue successfully, , reading successfuly.
how configure queue delete message after consumed it?
in listener, use

$c = new stomp($url); $c->subscribe('/queue/something'); echo $c->readframe(); 

you have acknowledge consumption of message them "deleted" queue. can $stomp->ack($messageid).

if don't want explicitely acknowledge receipt, can set headers of $stomp->subscribe of ack auto. make server auto acknowledge message , assume correctly delivered.

$stomp->subscribe('/queue/something', array('ack' => 'auto')); 

references:
http://php.net/manual/en/stomp.ack.php
http://php.net/manual/en/stomp.subscribe.php
https://stomp.github.io/stomp-specification-1.1.html#subscribe


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -