Skip to content

[suggestion] Support for AWS SQS GetQueueAttributes #391

@holtkamp

Description

@holtkamp

When a AWS SQS Message is fetched from a MessageQueue and is not "acknowledged" that it has been processed, it is considered to be "in flight".

To determine the number of "in flight" Messages on a MessageQueue, the GetQueueAttributes() action can be used, which also provides access to other usefull information about the MessageQueue.

The current Driver::info() could/should be used for this?

As implementation something like this can be done for the SQS Driver:

//SqsDriver.php
public function info(string $queueName = null): array
{
    $queueAttributes = [
            'prefetch' => $this->prefetch,
        ];

        if(is_string($queueName)){
            $queueUrl = $this->resolveUrl($queueName);
            $result = $this->sqs->getQueueAttributes([
                'AttributeNames' => ['All'],
                'QueueUrl' => $queueUrl,
            ]);


            $queueAttributes += $result['Attributes'] ?? [];
        }

        return $queueAttributes;
}
//AbstractQueue.php
public function info(){
    return []; //empty array for now
}
//PersistentQueue.php
public function info(){
    return $this->driver->info($this->name);
}

Would support for such a method something to be adopted in Bernard, or is it too technology-specific?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions