From f5b067ac402ddd8281f1fa4f5dfc57f3d25fdab0 Mon Sep 17 00:00:00 2001 From: Joakim Friberg Date: Wed, 11 Nov 2015 10:29:07 +0100 Subject: [PATCH] Fixed double serialization of message data, it has already been done in MessageService::createMessage --- Event/Queue/SidekiqMessageQueue.php | 20 ++------------------ Resources/config/services.yml | 2 -- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Event/Queue/SidekiqMessageQueue.php b/Event/Queue/SidekiqMessageQueue.php index a7f8990..cd5afa1 100644 --- a/Event/Queue/SidekiqMessageQueue.php +++ b/Event/Queue/SidekiqMessageQueue.php @@ -13,28 +13,14 @@ class SidekiqMessageQueue implements MessageQueueInterface */ protected $sidekiq; - /** - * @var \Symfony\Component\Serializer\SerializerInterface eventSerializer - * - */ - protected $eventSerializer; - - /** - * @var serializerFormat - * - */ - protected $serializerFormat; - /** * @param Client $sidekiq * @param SerializerInterface $eventSerializer * @param $serializerFormat */ - public function __construct(Client $sidekiq, SerializerInterface $eventSerializer, $serializerFormat) + public function __construct(Client $sidekiq) { $this->sidekiq = $sidekiq; - $this->serializerFormat = $serializerFormat; - $this->eventSerializer = $eventSerializer; } /** @@ -47,8 +33,6 @@ public function __construct(Client $sidekiq, SerializerInterface $eventSerialize public function addMessage(QueueMessage $message, $delay = 0) { //The sidekiq worker does not support message headers - $eventData = $this->eventSerializer->serialize($message->getData(), $this->serializerFormat); - - $this->sidekiq->perform('DeferEvent', [$eventData]); + $this->sidekiq->perform('DeferEvent', [$message->getData()]); } } diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 523d43e..70704a1 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -4,8 +4,6 @@ services: public: false arguments: - ~ - - @fervo_deferred_event.serializer - - %fervo_deferred_event.serializer_format% fervo_deferred_event.queue.immediate: class: Fervo\DeferredEventBundle\Event\Queue\ImmediateMessageQueue