Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Jobboy Driver Doctrine

Jobboy Driver Doctrine Laravel Package

dansan/jobboy-driver-doctrine

JobBoy Doctrine Driver integrates the JobBoy queue/worker system with Doctrine, providing a Doctrine-backed driver and repository support for storing and processing jobs. Designed to work with JobBoy bundles and Doctrine ORM/DBAL setups.

View on GitHub
Deep Wiki
Context7

A Doctrine driver for JobBoy

Frequently asked questions about Jobboy Driver Doctrine
How do I install the JobBoy Doctrine Driver in a Laravel project?
First, require the package via Composer: `composer require dansan/jobboy-driver-doctrine`. Then, configure JobBoy to use the Doctrine driver in your `config/jobboy.php` file by setting the `driver` to `doctrine`. Ensure Doctrine ORM is already installed and configured in your Laravel app.
Does this package work with Laravel 10 and Doctrine 3.x?
Yes, the JobBoy Doctrine Driver supports Laravel 10 and Doctrine ORM 3.x. Verify compatibility by checking the package’s `composer.json` for required PHP and Doctrine versions. The driver leverages Doctrine DBAL, so any supported database (MySQL, PostgreSQL, etc.) will work.
Can I use this driver alongside Redis or other JobBoy drivers?
Yes, the driver is designed to work alongside other JobBoy drivers. You can configure multiple drivers in JobBoy’s configuration and route specific jobs to Doctrine for persistence while using Redis or AMQP for high-throughput queues. This is useful for hybrid architectures.
How do I customize the job table schema for Doctrine?
The package provides a default schema, but you can extend it by creating a custom Doctrine entity for jobs. Override the `Job` entity class in your `config/jobboy.php` under the `doctrine` section. Add fields like `priority`, `timeout`, or `attempts` as needed, then update your migrations accordingly.
What’s the best way to handle failed jobs and retries with this driver?
Failed jobs are stored in the Doctrine table with their status, payload, and retry count. Configure retry logic in JobBoy’s `config/jobboy.php` under `retry_strategy`. For exponential backoff, use JobBoy’s built-in retry mechanisms. Failed jobs can be queried via Doctrine queries (e.g., `WHERE status = 'failed'`).
Will this driver work in a high-concurrency environment (e.g., 10,000 jobs/hour)?
Doctrine ORM introduces overhead compared to in-memory or message-broker-based queues, so performance may degrade under extreme load. Benchmark your setup and consider read replicas for monitoring queries. For ultra-high throughput, pair this with a Redis driver for enqueuing while using Doctrine for persistence.
How do I test job persistence with this driver in PHPUnit?
Mock the Doctrine EntityManager in your tests to avoid hitting a real database. Use PHPUnit’s `createMock` to simulate job enqueuing, processing, and persistence. For integration tests, use an in-memory SQLite database or a test container with Doctrine configured. Ensure your tests cover job status transitions (e.g., `pending` → `processed` → `failed`).
Can I monitor job statuses in real-time (e.g., via a dashboard)?
Yes, since jobs are stored in a relational database, you can query them directly with Doctrine or raw SQL. Create a dashboard using Laravel’s query builder or Eloquent to fetch job statuses, retries, or payloads. For real-time updates, consider polling the database or using Laravel Echo with WebSockets.
What alternatives exist if I don’t want to use Doctrine for job persistence?
If Doctrine isn’t a requirement, consider JobBoy’s Redis driver for low-latency queues or Symfony Messenger for built-in Doctrine support (though it’s heavier). For Laravel, packages like `spatie/laravel-queue-redis` or `laravel-horizon` (with Redis) are popular alternatives. Evaluate based on your need for persistence vs. performance.
How do I handle job deduplication to prevent duplicate processing?
Implement deduplication by adding a unique constraint (e.g., `job_id` + `payload_hash`) to your Doctrine job table. Use JobBoy’s `JobInterface` to generate a consistent hash of the job payload before enqueuing. If duplicates are detected, skip processing or log the conflict. This requires custom logic in your job handler.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle