boa框架开发手册v5.2

消息队列

支持列表

ActiveMQActiveMQ ArtemisApollo
CoilMQGozirraHornetQ
MorbidQRabbitMQSprinkle
StampyStompConnectStompServer
ZeroMQ

生产发布


boa::mq()->publish('Hello World! Hello PHP!');

消费订阅


$mq = boa::mq();
$mq->subscribe();
while($mq->has()){
	$body = $mq->read();
	$head = $mq->head();
	$mq->ack();

	echo($body);
	ob_flush();
}
$mq->unsubscribe();