where('input', 'like', '%TableOfOffer%')->where('attempt_count', 0)->whereNull('job_status')->orderBy('created_at','desc')->limit(20)->get(); $rabbitMqObj = new RabbitMQ(); $this->comment('Queue Log '. count($jobs)); foreach ($jobs as $job) { QueueLog::where('job_id', $job->job_id)->update(['job_status' => 1]); $this->comment('Job Id '. $job->job_id); $bodyObj = new \stdClass(); $bodyObj->body = $job; $rabbitMqObj->callMeBack($bodyObj); $this->comment('Executed '. $job->job_id); } /* $arguments = $this->arguments(); (new Slack(new Request(['title' => 'RabbitMQ Lis', 'fields' => ['arg' => json_encode($arguments)], 'group' => Slack::$STAGE_TESTING])))->send(); if(Arr::has($arguments,'q_name','')) { (new Slack(new Request(['title' => 'RabbitMQ Lis 1', 'fields' => ['if in' => true], 'group' => Slack::$STAGE_TESTING])))->send(); $q_bind = false; if(1 == Arr::get($arguments,'q_bind', 0)) { $q_bind = true; } $rabbitMqObj = new RabbitMQ(); $output = $rabbitMqObj->basicConsume(Arr::get($arguments,'q_name',''), Arr::get($arguments,'q_tag',''), $q_bind, Arr::get($arguments,'exchange',''), Arr::get($arguments,'route_key','')); (new Slack(new Request(['title' => 'RabbitMQ Lis out 3', 'fields' => ['out' => json_encode($output)], 'group' => Slack::$STAGE_TESTING])))->send(); $this->info($output); // Loop as long as the channel has callbacks registered $ret = $rabbitMqObj->loopCallback(); (new Slack(new Request(['title' => 'RabbitMQ Lis ret', 'fields' => ['ret' => json_encode($ret)], 'group' => Slack::$STAGE_TESTING])))->send(); $this->info($ret); $this->info("Execution complete"); } else { $this->error("Queue name argument is missing"); }*/ } 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()); } } }