for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Xervice\RabbitMQ\Business\Model\Worker\Listener;
use DataProvider\RabbitMqMessageDataProvider;
use PhpAmqpLib\Channel\AMQPChannel;
use Xervice\Core\Plugin\AbstractBusinessPlugin;
use Xervice\RabbitMQ\Business\Dependency\Worker\Listener\ListenerInterface;
abstract class AbstractListener extends AbstractBusinessPlugin implements ListenerInterface
{
protected const DEFAULT_CHUNKSIZE = 100;
/**
* @return int
*/
public function getChunkSize() : int
return self::DEFAULT_CHUNKSIZE;
}
* @param \PhpAmqpLib\Channel\AMQPChannel $channel
* @param \DataProvider\RabbitMqMessageDataProvider $messageDataProvider
public function sendAck(
AMQPChannel $channel,
RabbitMqMessageDataProvider $messageDataProvider,
bool $multiple = false
): void
$channel->basic_ack($messageDataProvider->getDeliveryTag(), $multiple);
public function sendNack(
bool $multiple = false,
bool $requeue = true
$channel->basic_nack($messageDataProvider->getDeliveryTag(), $multiple, $requeue);