PHPackages                             sergo920/laravel-queue-aws-batch - 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. sergo920/laravel-queue-aws-batch

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

sergo920/laravel-queue-aws-batch
================================

Laravel Queue for AWS Batch, enabling users to submit jobs for processing to a Batch queue.

17.9kPHP

Since Aug 11Pushed 3y agoCompare

[ Source](https://github.com/sergo920/laravel-queue-aws-batch)[ Packagist](https://packagist.org/packages/sergo920/laravel-queue-aws-batch)[ RSS](/packages/sergo920-laravel-queue-aws-batch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Queue for AWS Batch
---------------------------

[](#laravel-queue-for-aws-batch)

[![Latest Version on Packagist](https://camo.githubusercontent.com/35f46cf253bbdbe0b9d2d874917900df501fd54e73685849e1513aa6bcd9fd6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646e786c6162732f6c61726176656c2d71756575652d6177732d62617463682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dnxlabs/laravel-queue-aws-batch)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9cc07979e6b29c98aa2bcffd92fa6b62dd14ff076c4e0c72f123303e4e1ec416/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646e786c6162732f6c61726176656c2d71756575652d6177732d62617463682f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dnxlabs/laravel-queue-aws-batch)[![Code Coverage](https://camo.githubusercontent.com/0923bd3a9b6d60fb9f161b0f793f2919b5d1e6675a8fd109e02b6e82e2b11c03/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f646e786c6162732f6c61726176656c2d71756575652d6177732d62617463682f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dnxlabs/laravel-queue-aws-batch/?branch=master)

### Supported Versions

[](#supported-versions)

Laravel VersionPackage TagSupported6.0.x3.0.xyes### Installation

[](#installation)

See the table above for package version information, and change the version below accordingly.

Add custom repository to your composer json:

```
    "require": {
        "dnxlabs/laravel-queue-aws-batch": "~3.0.0"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@github.com:dnxlabs/laravel-queue-aws-batch.git"
        }
    ]

```

Using `composer`, run:

```
composer require dnxlabs/laravel-queue-aws-batch ~3.0

```

### Usage

[](#usage)

1. Your Laravel application will need to be dockerized and pushed into a container registry of your choice. The `ENTRYPOINT`should be set to `artisan`.
2. Add a new queue to your `config/queues.php` config file's `connections` array:

```
    [
        'batch' => [
            'driver' => 'batch',
            'table' => 'jobs',
            'queue' => 'first-run-job-queue',
            'jobDefinition' => 'my-job-definition',
            'expire' => 60,
            'region' => 'us-east-1'
        ]
    ]

```

This queue transport depends on being able to write it's queue jobs to a database queue. In this example, it writes it's jobs to the `jobs` table. You'll need to use the `artisan queue:table` to create a migration to create this table.

3. Create an AWS Batch job queue with the same name as the `queue` config setting. This is where the Batch connector will push your jobs into Batch. In this case, my queue name would be `first-run-job-queue`.
4. Create a AWS Batch job definition for each queue you define that looks something like this:

```
{
    "jobDefinitionName": "my-laravel-application",
    "type": "container",
    "parameters": {},
    "retryStrategy": {
        "attempts": 10
    },
    "containerProperties": {
        "image": "",
        "vcpus": 1,
        "memory": 256,
        "command": [
            "queue:work-batch",
            "Ref::jobId",
            "--tries=3"
        ],
        "volumes": [],
        "environment": [],
        "mountPoints": [],
        "ulimits": []
    }
}
```

Here, you configure your container to start, run the `queue:work-batch` command (assuming `artisan` is your entrypoint) and pass in the name of the queue, `first-run-job-queue` as well as the `Ref::jobId` param, which is passed in when the Batch connector creates the job.

It is important that you configure a retryStrategy with more "attempts" than you are running `tries` if you provide that argument. Otherwise, Batch will not retry your job if it fails. Laravel 5.1 does not write to the failed job queue until the *next* run after tries has been exceeded by jobs failing. Newer versions will write to the queue in the same run, so this requirement can be relaxed later.

6. Add the Service Provider to your application:
    - In `config/app.php` add to the `providers` array: `DNXLabs\LaravelQueueAwsBatch\BatchQueueServiceProvider::class`

### Limitations

[](#limitations)

#### Delayed Jobs

[](#delayed-jobs)

AWS Batch has no method to delay a job and as it's our runner, we don't have an easy work around. If you require delayed jobs for your use case, at this point my recommendation would be to use a regular DB queue, and to fire a job into it which will fire your batch job at the correct time.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 59% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e6dc582e7f7bcf3d811eb46814a00929451ec860f0c71725597c719128b3515?d=identicon)[sergo920](/maintainers/sergo920)

---

Top Contributors

[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (49 commits)")[![antonioftamura](https://avatars.githubusercontent.com/u/45120410?v=4)](https://github.com/antonioftamura "antonioftamura (24 commits)")[![sohflp](https://avatars.githubusercontent.com/u/57083757?v=4)](https://github.com/sohflp "sohflp (7 commits)")[![sergo920](https://avatars.githubusercontent.com/u/6864423?v=4)](https://github.com/sergo920 "sergo920 (3 commits)")

### Embed Badge

![Health badge](/badges/sergo920-laravel-queue-aws-batch/health.svg)

```
[![Health](https://phpackages.com/badges/sergo920-laravel-queue-aws-batch/health.svg)](https://phpackages.com/packages/sergo920-laravel-queue-aws-batch)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M170](/packages/react-async)

PHPackages © 2026

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