|
@ -32,9 +32,24 @@ class Publisher extends Command |
|
|
$time = -microtime(true); |
|
|
$time = -microtime(true); |
|
|
echo PHP_EOL; |
|
|
echo PHP_EOL; |
|
|
|
|
|
|
|
|
|
|
|
$requeue = "requeue #"; |
|
|
|
|
|
$requeued = rand(1, ((int) $this->option('count'))-1); |
|
|
|
|
|
|
|
|
|
|
|
$finish = "finish #"; |
|
|
|
|
|
$finished = rand($requeued, ((int) $this->option('count'))); |
|
|
|
|
|
|
|
|
for ($index = 1; $index <= (int) $this->option('count'); $index++) { |
|
|
for ($index = 1; $index <= (int) $this->option('count'); $index++) { |
|
|
$chance = rand(1, 100); |
|
|
|
|
|
$payload = $chance <= 20 ? "finish #$index" : ($chance <= 40 ? "requeue #$index" : "Message #$index"); |
|
|
|
|
|
|
|
|
$payload = "message #"; |
|
|
|
|
|
|
|
|
|
|
|
if ($index == $requeued) { |
|
|
|
|
|
echo "HERE 1".PHP_EOL; |
|
|
|
|
|
$payload = $requeue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($index == $finished) { |
|
|
|
|
|
echo "HERE 2".PHP_EOL; |
|
|
|
|
|
$payload = $finish; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$message = [ |
|
|
$message = [ |
|
|
'content_type' => 'text/plain', |
|
|
'content_type' => 'text/plain', |
|
@ -79,7 +94,7 @@ class Publisher extends Command |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
$message = new ProducibleMessage( |
|
|
$message = new ProducibleMessage( |
|
|
message: $payload, |
|
|
|
|
|
|
|
|
message: $payload.$index, |
|
|
properties: $publish + $message, |
|
|
properties: $publish + $message, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|