get(); } else { $jobs = QueueLog::where('status','!=', 'com')->where('input', 'not like', '%TableOfOffer%')->where('attempt_count', 0)->whereNull('job_status')->limit(20)->get(); $this->comment('Queue Log '. count($jobs)); } $rabbitMqObj = new RabbitMQ(); foreach ($jobs as $job) { QueueLog::where('job_id', $job->job_id)->update(['job_status' => 1]); if (!$id) { $this->comment('Job Id '. $job->job_id); } $bodyObj = new \stdClass(); $bodyObj->body = $job; $rabbitMqObj->callMeBack($bodyObj, $this, $automation); if (!$id) { $this->comment('Executed '. $job->job_id); } else { return true; } } } catch (\Exception $e) { $this->comment('Exception '.$e->getMessage()); //(new Slack(new Request(['title' => 'RabbitMQ Lis ex', 'fields' => ['m' => $e->getMessage(), 'l' => $e->getLine(), 'f' => $e->getFile()], 'group' => Slack::$STAGE_TESTING])))->send(); //$this->error($e->getMessage()); } } }