Closed davidwindell closed 6 years ago
hi
$metadata should not be an object
as [] += {}
will fail.
do you use the new BinaryMessageInterface on your jobs?
What queue adapter are you using?
Hi @basz, it's the Doctrine Queue, the next step up in the stack track is at https://github.com/juriansluiman/SlmQueueDoctrine/blob/master/src/Queue/DoctrineQueue.php#L177.
Which version?
'composer show'
And do you use the newly introduced binaryjobinterface on one of your jobs?
Op 3 feb. 2017 om 01:22 heeft David Windell notifications@github.com het volgende geschreven:
Hi @basz, it's the Doctrine Queue, the next step up in the stack track is at https://github.com/juriansluiman/SlmQueueDoctrine/blob/master/src/Queue/DoctrineQueue.php#L177.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
...
slm/queue v0.6.0
slm/queue-doctrine 0.6.1
...
All jobs extend SlmQueueAbstractJob
Ok so not the problem is not with latest release, which is good.
I have no idea why this error happens other then that the metadata is an object. Can you tell me if you do anything strange when creating a job? Or inside it and reading it. Do you use setting metadata yourself?
Additionally; it might be useful to inspect the data field in the db to deter main if it the push or the pop job side of things.
Op 3 feb. 2017 om 16:42 heeft David Windell notifications@github.com het volgende geschreven:
... slm/queue v0.6.0 slm/queue-doctrine 0.6.1 ... All jobs extend SlmQueueAbstractJob
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Did you have anymore info on this?
Could it be to do with the manual setting of the metadata in our Abstract Job? i.e. setMetadata
?
<?php
namespace Zebreco\Job;
use SlmQueue\Job\AbstractJob as SlmQueueAbstractJob;
use SlmQueue\Queue\QueueAwareInterface;
use SlmQueue\Queue\QueueAwareTrait;
abstract class AbstractJob extends SlmQueueAbstractJob implements QueueAwareInterface
{
use QueueAwareTrait;
public function setRetries(int $retries)
{
$this->setMetadata('__retries__', $retries);
return $this;
}
public function getRetries()
{
return $this->getMetadata('__retries__');
}
protected function retryJob(int $delay = 60)
{
$this->setRetries($this->getRetries() + 1);
$this->getQueue()->push($this, [
'delay' => $delay
]);
}
}
The only other thing I can see is one of the array keys that we send to $job->setContent()
is called "metadata" too.
looking at Zend\Stdlib\Message that (metadata in content) should not be a problem.
I would suggest avoid using XXX as metadata keys. we use id for example, but there are others too. consider __ as private to slmQueue
do you have the data of a payload that fails?
i don't understand how your metadata could be :
{
__id__: 862613
}
should atleast have a name too. see https://github.com/juriansluiman/SlmQueue/blob/master/src/Queue/AbstractQueue.php#L100
I'll get some detailed logging setup when I'm back from holiday in a week or so. Thanks!
Any update on this @davidwindell? Have not heard anyone else or encountered this myself. Will close for now; but feel free to open if you have new info!
I'm seeing the below error intermittently, not quite sure why (at https://github.com/juriansluiman/SlmQueue/blob/master/src/Queue/AbstractQueue.php#L65).
$metadata
is: