Configuration
BabelQueue plugs into Laravel’s queue system as a custom connection driver, then adds its own URN routing and dead-letter config.
Queue connection
Add a BabelQueue connection in config/queue.php. Use babelqueue-redis for the
Redis transport:
// config/queue.php
'connections' => [
'babelqueue' => [
'driver' => 'babelqueue-redis',
'connection' => 'default',
'queue' => env('BABELQUEUE_QUEUE', 'default'),
'retry_after' => 90,
],
],
Or babelqueue-rabbitmq for the RabbitMQ transport:
// config/queue.php
'connections' => [
'babelqueue' => [
'driver' => 'babelqueue-rabbitmq',
'host' => env('RABBITMQ_HOST', '127.0.0.1'),
'port' => env('RABBITMQ_PORT', 5672),
'queue' => env('BABELQUEUE_QUEUE', 'default'),
],
],
Package configuration
config/babelqueue.php maps incoming URNs to handler classes and controls what
happens to messages with an unknown URN:
// config/babelqueue.php
return [
// Map each URN to the handler that consumes it.
'handlers' => [
'urn:babel:orders:created' => App\Babel\Handlers\OrderCreatedHandler::class,
],
// What to do when an incoming URN has no registered handler:
// 'fail' | 'delete' | 'release' | 'dead_letter'
'on_unknown_urn' => 'dead_letter',
// Where exhausted / unroutable messages go. Failures from "orders"
// are republished to "orders.dlq" as the same envelope plus an
// additive `dead_letter` block, so any SDK can triage them.
'dead_letter' => [
'enabled' => true,
'suffix' => '.dlq',
],
];
Next: Producing messages.