Skip to content

Commit

Permalink
Fixed double serialization of message data, it has already been done …
Browse files Browse the repository at this point in the history
…in MessageService::createMessage
  • Loading branch information
morticue committed Nov 11, 2015
1 parent b64919f commit f5b067a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 2 additions & 18 deletions Event/Queue/SidekiqMessageQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -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()]);
}
}
2 changes: 0 additions & 2 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5b067a

Please sign in to comment.