Skip to content

No queue specified and no default queue configured #5

Closed

Description

@BadrtSoft
## Bug description

`leaf queue:work` ignores the configured default queue when the optional `--queue` option is omitted. It reports:

> No queue specified and no default queue configured. Set `default` in your queue config or pass --queue.

The application has a valid default queue configured, and `MvcConfig('queue')` returns it correctly.

## Steps to reproduce

1. Configure a default queue:

   ```php
   return [
       'default' => 'database',
       'connections' => [
           'database' => [
               'driver' => 'database',
               // ...
           ],
       ],
   ];
  1. Run:

    leaf queue:work
  2. The command reports that no queue is configured instead of using database.

Expected behavior

When --queue is omitted, the worker should use the default value from the queue configuration.

Actual behavior

The worker reports that no queue is configured, even though MvcConfig('queue')['default'] contains database.

Proposed solution

In QueueWorkCommand::resolveQueueConnection(), treat an empty option like an omitted option when selecting the queue:

$queue = $option ?: ($config['default'] ?? null);

This allows the configured default to be used when Sprout returns an empty string for the missing optional --queue option. Explicit queue names continue to take precedence.

Environment

  • leafs/queue: v5.0
  • leafs/sprout: v5
  • PHP: 8.2+
  • Queue driver: database

Activity

  1. BadrtSoft commented on Oct 27, 2026

    @BadrtSoft
    ContributorAuthor

    resolved Here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions