Question

I have SQS working with Laravel. All works well but I really need to be able to access the Queue properties. I know AWS/SQS provides these methods and I see protected methods when I look at the contents of

Queue::getSqs()

But not seeing any native Laravel way to access the queue attributes. How can I access them?

Was it helpful?

Solution

You are correct - they are protected methods. But when you run Queue::getSqs() - it is returning the underlying SQS instance - which means you have access to those methods.

So this works:

$list = Queue::getSqs()->listQueues();

As does this:

$attr = Queue::getSqs()->getQueueAttributes(array('QueueUrl' => 'string'));

A full list of available commands is here at the AWS website.

OTHER TIPS

Looking at the API I believe you can access the raw attributes with Queue::getSqsJob(). Worth a shot, I can't test as I am on the road.

http://laravel.com/api/class-Illuminate.Queue.Jobs.SqsJob.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top