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

Queue Bundle Laravel Package

duguncom/queue-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require duguncom/queue-bundle
    

    Register the bundle in config/app.php under providers:

    Dugincom\QueueBundle\QueueBundle::class,
    
  2. Configuration Publish the default config:

    php artisan vendor:publish --provider="Dugincom\QueueBundle\QueueBundle" --tag="config"
    

    Edit config/queue.php (if provided) or check the bundle’s default settings.

  3. First Use Case Dispatch a job using Laravel’s queue facade:

    use Illuminate\Support\Facades\Queue;
    
    Queue::push(new \App\Jobs\ProcessPodcast);
    

    Verify the job is processed by checking the configured queue driver (e.g., database, redis).


Implementation Patterns

Core Workflows

  1. Job Dispatching Use Laravel’s built-in queue helpers:

    // Delayed job
    Queue::later(now()->addMinutes(10), new \App\Jobs\SendEmail);
    
    // Batch processing
    Queue::batch(new \App\Jobs\GenerateReport, 5);
    
  2. Queue Monitoring Extend the bundle’s monitoring capabilities (if available) or integrate with Laravel’s queue:work:

    php artisan queue:work --sleep=3 --tries=3
    
  3. Custom Queue Connections Define a custom connection in config/queue.php:

    'connections' => [
        'custom' => [
            'driver' => 'database',
            'table' => 'custom_jobs',
            'queue' => 'custom_queue',
        ],
    ],
    

    Use it in jobs:

    Queue::connection('custom')->push(new \App\Jobs\CustomJob);
    

Integration Tips

  • Event-Driven Queues: Trigger jobs from events:
    event(new PodcastPublished($podcast));
    // In listener:
    Queue::push(new ProcessPodcast($podcast));
    
  • Middleware: Use Laravel’s queue middleware to log or validate jobs:
    Queue::before(function ($job, $data) {
        logger()->info("Job {$job->getJob()} dispatched");
    });
    
  • Retry Logic: Leverage Laravel’s retry mechanism:
    Queue::push(new \App\Jobs\FragileJob)->retryUntil(5);
    

Gotchas and Tips

Pitfalls

  1. Outdated Package

    • Last release in 2020; verify compatibility with Laravel 10.x/11.x.
    • Test thoroughly—assume undocumented breaking changes.
  2. Lack of Documentation

    • No clear extension points or customization guides. Rely on Laravel’s queue docs for core functionality.
    • Example: If the bundle adds custom commands, check vendor/duguncom/queue-bundle/src/Console for clues.
  3. Queue Driver Assumptions

    • The bundle may assume a specific driver (e.g., database). If using redis or beanstalkd, ensure the bundle doesn’t override configurations silently.

Debugging

  • Job Stuck in Queue? Manually inspect the queue table (for database driver):

    SELECT * FROM jobs WHERE queue = 'default';
    

    Delete stale jobs with:

    php artisan queue:flush
    
  • Logs Enable queue logging in config/queue.php:

    'logging' => true,
    

Extension Points

  1. Custom Job Classes Extend Laravel’s Illuminate\Bus\Queueable for shared logic:

    class BaseJob implements ShouldQueue {
        use Dispatchable, InteractsWithQueue, Queueable;
        // Shared retry/timeout logic
    }
    
  2. Service Provider Hooks Override bundle behavior by binding interfaces in your AppServiceProvider:

    public function register() {
        $this->app->bind(
            \Dugincom\QueueBundle\Contracts\QueueWorker::class,
            \App\Services\CustomQueueWorker::class
        );
    }
    
  3. Queue Events Listen for queue events (if supported):

    Queue::after(function ($job, $data) {
        // Post-processing
    });
    

Pro Tips

  • Testing Queues Use Laravel’s Queue::fake() in tests:
    public function test_job_processing() {
        Queue::fake();
        Queue::push(new \App\Jobs\TestJob);
        Queue::assertPushed(\App\Jobs\TestJob::class);
    }
    
  • Horizontal Scaling For high-load systems, pair with Laravel Horizon or Supervisor to manage workers:
    supervisorctl reread
    supervisorctl update
    
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.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed