Renamed Rabbit instances to use RabbitMq

This commit is contained in:
Alejandro Celaya
2021-12-12 10:32:57 +01:00
parent cb1705b6e8
commit 8e5730f374
6 changed files with 21 additions and 20 deletions

View File

@@ -23,7 +23,7 @@ return [
'async' => [
EventDispatcher\Event\VisitLocated::class => [
EventDispatcher\NotifyVisitToMercure::class,
EventDispatcher\NotifyVisitToRabbit::class,
EventDispatcher\NotifyVisitToRabbitMq::class,
EventDispatcher\NotifyVisitToWebHooks::class,
EventDispatcher\UpdateGeoLiteDb::class,
],
@@ -35,7 +35,7 @@ return [
EventDispatcher\LocateVisit::class => ConfigAbstractFactory::class,
EventDispatcher\NotifyVisitToWebHooks::class => ConfigAbstractFactory::class,
EventDispatcher\NotifyVisitToMercure::class => ConfigAbstractFactory::class,
EventDispatcher\NotifyVisitToRabbit::class => ConfigAbstractFactory::class,
EventDispatcher\NotifyVisitToRabbitMq::class => ConfigAbstractFactory::class,
EventDispatcher\UpdateGeoLiteDb::class => ConfigAbstractFactory::class,
],
@@ -43,7 +43,7 @@ return [
EventDispatcher\NotifyVisitToMercure::class => [
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
],
EventDispatcher\NotifyVisitToRabbit::class => [
EventDispatcher\NotifyVisitToRabbitMq::class => [
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
],
EventDispatcher\NotifyVisitToWebHooks::class => [
@@ -74,12 +74,12 @@ return [
'em',
'Logger_Shlink',
],
EventDispatcher\NotifyVisitToRabbit::class => [
EventDispatcher\NotifyVisitToRabbitMq::class => [
AMQPStreamConnection::class,
'em',
'Logger_Shlink',
Visit\Transformer\OrphanVisitDataTransformer::class,
'config.rabbit.enabled',
'config.rabbitmq.enabled',
],
EventDispatcher\UpdateGeoLiteDb::class => [GeolocationDbUpdater::class, 'Logger_Shlink'],
],

View File

@@ -17,7 +17,7 @@ use Throwable;
use function Shlinkio\Shlink\Common\json_encode;
use function sprintf;
class NotifyVisitToRabbit
class NotifyVisitToRabbitMq
{
private const NEW_VISIT_QUEUE = 'https://shlink.io/new-visit';
private const NEW_ORPHAN_VISIT_QUEUE = 'https://shlink.io/new-orphan-visit';

View File

@@ -18,7 +18,7 @@ use RuntimeException;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\EventDispatcher\Event\VisitLocated;
use Shlinkio\Shlink\Core\EventDispatcher\NotifyVisitToRabbit;
use Shlinkio\Shlink\Core\EventDispatcher\NotifyVisitToRabbitMq;
use Shlinkio\Shlink\Core\Model\ShortUrlMeta;
use Shlinkio\Shlink\Core\Model\Visitor;
use Shlinkio\Shlink\Core\Visit\Transformer\OrphanVisitDataTransformer;
@@ -27,11 +27,11 @@ use Throwable;
use function count;
use function Functional\contains;
class NotifyVisitToRabbitTest extends TestCase
class NotifyVisitToRabbitMqTest extends TestCase
{
use ProphecyTrait;
private NotifyVisitToRabbit $listener;
private NotifyVisitToRabbitMq $listener;
private ObjectProphecy $connection;
private ObjectProphecy $em;
private ObjectProphecy $logger;
@@ -49,7 +49,7 @@ class NotifyVisitToRabbitTest extends TestCase
$this->em = $this->prophesize(EntityManagerInterface::class);
$this->logger = $this->prophesize(LoggerInterface::class);
$this->listener = new NotifyVisitToRabbit(
$this->listener = new NotifyVisitToRabbitMq(
$this->connection->reveal(),
$this->em->reveal(),
$this->logger->reveal(),
@@ -61,7 +61,7 @@ class NotifyVisitToRabbitTest extends TestCase
/** @test */
public function doesNothingWhenTheFeatureIsNotEnabled(): void
{
$listener = new NotifyVisitToRabbit(
$listener = new NotifyVisitToRabbitMq(
$this->connection->reveal(),
$this->em->reveal(),
$this->logger->reveal(),