Bånder

QueueController extends Controller
in package

Queue monitoring and management controller

Provides comprehensive queue system monitoring including job tracking, metrics collection, failure analysis, and administrative operations. Supports job retry functionality and queue health monitoring for system maintenance.

Attributes
#[Middleware]
['auth:sanctum', 'ability:' . \App\Models\TokenAbility::ACCESS_API->value, 'force.json']
#[Prefix]
'/queue-metrics'

Table of Contents

Properties

$logger  : LoggerInterface
$metricsService  : QueueMetricsService

Methods

__construct()  : mixed
delete()  : Response
Delete a specific queue monitor entry
metrics()  : JsonResponse
Get comprehensive queue metrics and statistics
purge()  : Response
Purge all queue monitor records
queues()  : JsonResponse
Get list of all available queue names
retry()  : JsonResponse
Retry a failed queue job
show()  : JsonAnonymousResourceCollection
Get paginated collection of queue monitor entries
denyWithStatus()  : mixed
gateCheckExecuteJob()  : mixed
gateCheckViewDashboard()  : mixed
noContent()  : mixed

Properties

$logger read-only

private LoggerInterface $logger
Tags
noinspection

PhpPropertyOnlyWrittenInspection

Attributes
#[LogChannel]
\App\Modules\Logging\Channel::Daily

Methods

delete()

Delete a specific queue monitor entry

public delete(string $id) : Response

Permanently removes a queue monitor record from the system. This only affects monitoring data and does not impact actual queue jobs. Used for cleaning up monitoring history.

Parameters
$id : string

The queue monitor ID to delete

Tags
throws
AuthorizationException

When user lacks dashboard access

throws
ModelNotFoundException

When monitor entry is not found

status

204

Attributes
#[Delete]
'{id}'
'api.queue-metrics.delete'
Return values
Response

metrics()

Get comprehensive queue metrics and statistics

public metrics(MetricsRequest $request) : JsonResponse

Returns detailed metrics about queue performance including job counts, execution times, failure rates, and trend analysis over the specified time period for system monitoring and optimization.

Parameters
$request : MetricsRequest

Request with optional aggregateDays parameter

Tags
throws
AuthorizationException

When user lacks dashboard access

response

array<array{ title: string, value: float, previousValue: int|null, format: string, formattedValue: string, formattedPreviousValue: string|null }>

Attributes
#[Get]
'/metrics'
'api.queue-metrics.metrics'
Return values
JsonResponse

purge()

Purge all queue monitor records

public purge() : Response

Completely clears all queue monitoring data from the system. This is a destructive operation that removes all historical job tracking information. Use with extreme caution in production environments.

Tags
throws
AuthorizationException

When user lacks dashboard access

status

204

Attributes
#[Delete]
'/purge'
'api.queue-metrics.purge'
Return values
Response

queues()

Get list of all available queue names

public queues() : JsonResponse

Returns a distinct list of all queue names currently in the monitoring system. Useful for populating filter dropdowns and understanding queue structure.

Tags
throws
AuthorizationException

When user lacks dashboard access

response

array<array{name: string}>

Attributes
#[Get]
'/queues'
'api.queue-metrics.queues'
Return values
JsonResponse

retry()

Retry a failed queue job

public retry(RetryJobRequest $request, string $id) : JsonResponse

Attempts to retry a previously failed job by re-dispatching it to the queue. Only failed jobs that haven't been retried and have valid job UUIDs can be retried. Includes safety checks and error handling.

Parameters
$request : RetryJobRequest

Request for job retry operation

$id : string

The queue monitor ID of the job to retry

Tags
throws
AuthorizationException

When user lacks dashboard access

throws
ModelNotFoundException

When job monitor entry is not found

throws
ValidationException

When job cannot be retried

response

array{ status: string, message: string }

Attributes
#[Post]
'/retry/{id}'
'api.queue-metrics.retry-job'
Return values
JsonResponse

show()

Get paginated collection of queue monitor entries

public show(ShowQueueMetricsRequest $request) : JsonAnonymousResourceCollection

Returns filtered and paginated queue job monitoring data with support for filtering by status, queue name, job name, and custom ordering options. Provides comprehensive job execution tracking and debugging information.

Parameters
$request : ShowQueueMetricsRequest

Request with filtering and pagination parameters

Tags
throws
AuthorizationException

When user lacks dashboard access

response

JsonAnonymousResourceCollection<JsonPaginator<QueueMonitorResource>>

Attributes
#[Get]
'/'
'api.queue-metrics.show'
Return values
JsonAnonymousResourceCollection

denyWithStatus()

protected denyWithStatus(string $message, int $status) : mixed
Parameters
$message : string
$status : int

gateCheckExecuteJob()

protected gateCheckExecuteJob() : mixed

gateCheckViewDashboard()

protected gateCheckViewDashboard() : mixed

        
On this page

Search results