Slide 20
Slide 20 text
Bunny – message consumer
$channel->run(
function (Message $message, Channel $channel) {
handleMessage($message);
$channel->ack($message);
// or requeue:
$channel->reject($message, $requeue);
},
'queue_name'
);
This is what you should run as a command line script. If everything went as expected, you should
acknowledge the message. If you're no longer interested in the message, you should reject it and
if you want to try processing it later, you should requeue it.