So, I have SQS setup and it receives messages from my Laravel 8 application by way of a Job. A request comes in and this request has data that is popped onto the queue. The queue worker then processes this message and writes it to the database. I am adding an index to the table that the data is written to, the alter table command locks the table during this operation. While the table is locked SQS does not receive any new messages despite the request processor working and dispatching jobs without error.
Any ideas why this would prevent the dispatched jobs from being queued?
class ProcessIncomingAISData implements ShouldQueue{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $ais_message;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(String $ais_message)
{
$this->ais_message = $ais_message;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
try{
$ais = AISData::factory($this->ais_message);
$ais->save();
return true;
}catch(Exception $e){
Log::error($e);
}
}
This job is called by:
ProcessIncomingAISData::dispatch($data)->onQueue('ais-incoming-data-queue');
