PHPackages                             ssigwart/sqs-queue-processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. ssigwart/sqs-queue-processor

ActiveLibrary[Queues &amp; Workers](/categories/queues)

ssigwart/sqs-queue-processor
============================

Library to process SQS queues.

v1.0.0(2y ago)03MITPHPPHP &gt;=8.1.0

Since Jan 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ssigwart/sqs-queue-processor)[ Packagist](https://packagist.org/packages/ssigwart/sqs-queue-processor)[ Docs](https://github.com/ssigwart/sqs-queue-processor)[ RSS](/packages/ssigwart-sqs-queue-processor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

SQS Queue Processor
===================

[](#sqs-queue-processor)

This library provides an SQS queue processor with the following features:

- Duplicate message processing.
- Delayed retry capability.
- Error handling options.

Installation
------------

[](#installation)

```
composer require ssigwart/sqs-queue-processor
```

Usage
-----

[](#usage)

Use the following to set up and run a queue processor.

```
$sqsQueueProcessor = new SqsQueueProcessor(/* Fill in parameters */);
$sqsQueueProcessor->processMessages();
```

### Parameter: `SqsQueueProcessorConfiguration`

[](#parameter-sqsqueueprocessorconfiguration)

- This parameter specifies the maximum number of messages to return on a single SQS `ReceiveMessage` call (default 10), the visibility timeout to use for received messages (default 300), and the number of seconds to wait for a message (default 20).
- You can also control what gets logged when processing messages.

### Parameter: `SqsQueueProcessorTimingInterface`

[](#parameter-sqsqueueprocessortiminginterface)

- This parameter will tell the queue processor when to stop processing messages using `shouldStopProcessingMessages`.
- To loop forever, have it always return false.
- You can also check the time and stop it after a given time.
- You can also have the same object implement this and `SqsQueueProcessorMessageProviderInterface` and have it stop after it has received an empty message list.

### Parameter: `SqsQueueProcessorCleanupInterface`

[](#parameter-sqsqueueprocessorcleanupinterface)

- This parameter includes cleanup functions such as `cleanUpAfterExceptionProcessingMessage`. If using a transactional database, you make want to call `ROLLBACK` on the database.

### Parameter: `SqsQueueProcessorMessageProviderInterface`

[](#parameter-sqsqueueprocessormessageproviderinterface)

- This parameter is used to get messages, delete messages, and update the visibility timeout on messages.
- It is recommended to use `AwsHighAvailabilitySqsMessageProvider`, which implements this interface.

### Parameter: `SqsQueueProcessorMessageStatusInterface`

[](#parameter-sqsqueueprocessormessagestatusinterface)

- This parameter provides functions to determine if a message is being processed or has completed processing.
- Suggested ways to implement this interface are with Memcached, Redis, or a database.

### Parameter: `SqsQueueProcessorSingleMessageProcessorInterface`

[](#parameter-sqsqueueprocessorsinglemessageprocessorinterface)

- This parameter is the core interface for processing the message.
- Your work to process the message should be in here.
- It should return a `SqsQueueProcessorSingleMessageProcessorResult`:
    - For a message that has completed processing successfully, return `SqsQueueProcessorSingleMessageProcessorResult::newSuccessResult()`.
    - For a message that you want to delay processing on, return `SqsQueueProcessorSingleMessageProcessorResult::newDelayedProcessingResult(...)` with a new visibility timeout.
    - For a message that had an error while processing, return `SqsQueueProcessorSingleMessageProcessorResult::newFailureResult(...)`, possibly with a new visibility timeout.
- It is recommended to catch any `Throwable`, do cleanup, and return a failure, but uncaught exceptions will be treated as a failure.

### Parameter: `SqsQueueProcessorErrorReportingInterface`

[](#parameter-sqsqueueprocessorerrorreportinginterface)

- This parameter provides error handling capabilities.
- Below are the suggested ways to handle different error types:
    - `MSG_MARKED_AS_COMPLETED` - Store raw `SqsMessage` in S3 and send an alert or create a task to review the message to be sure it was successfully processed. The S3 data can be used to requeue the message if needed.
    - `MSG_MARKED_AS_IN_PROGRESS` - Send an alert or create a task to review the message if a message has been marked as in progress for a while. It possibly the in-progress flag failed to be cleared when message processing failed.
    - `EXCEPTION_THROWN_HANDLING_MESSAGE` - Send an alert or create a task to investigate error.
    - `FAILED_TO_MARK_AS_PROCESSED` - Send an alert. This often won't be much of an issue. It becomes an issue if the message is failed to be marked as processed and the SQS message is received a second time (e.g. if an SQS delete failed).
    - `FAILED_TO_DELETE_MSG` - Send an alert or create a task to delete the message.
    - `FAILED_TO_CLEAR_MSG_IN_PROGRESS_FLAG` - Send an alert or create a task to clear the flag so the message can be processed again later.

### Parameter: `LoggerInterface`

[](#parameter-loggerinterface)

- This parameter is a `\Psr\Log\LoggerInterface`, so any implementation of that will do.
- All logged message will automatically have the SQS message ID appended to it to aid in distinguishing log messages for different SQS messages.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

866d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1426848?v=4)[Stephen Sigwart](/maintainers/ssigwart)[@ssigwart](https://github.com/ssigwart)

---

Top Contributors

[![ssigwart](https://avatars.githubusercontent.com/u/1426848?v=4)](https://github.com/ssigwart "ssigwart (1 commits)")

---

Tags

awsqueuesqsprocessor

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ssigwart-sqs-queue-processor/health.svg)

```
[![Health](https://phpackages.com/badges/ssigwart-sqs-queue-processor/health.svg)](https://phpackages.com/packages/ssigwart-sqs-queue-processor)
```

###  Alternatives

[shiftonelabs/laravel-sqs-fifo-queue

Adds a Laravel queue driver for Amazon SQS FIFO queues.

1556.0M3](/packages/shiftonelabs-laravel-sqs-fifo-queue)[enqueue/sqs

Message Queue Amazon SQS Transport

376.3M14](/packages/enqueue-sqs)[joblocal/laravel-sqs-sns-subscription-queue

A simple Laravel service provider which adds a new queue connector to handle SNS subscription queues.

48416.3k](/packages/joblocal-laravel-sqs-sns-subscription-queue)[pod-point/laravel-aws-pubsub

A Laravel broadcasting driver and queue driver that broadcasts and listens to published events utilising AWS SNS, EventBridge and SQS.

1096.1k](/packages/pod-point-laravel-aws-pubsub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
