- How do I install needle-project/laravel-rabbitmq in a Laravel application?
- Install it with Composer using composer require needle-project/laravel-rabbitmq, then configure your RabbitMQ connection, exchanges, and queues in the package configuration. Because the package is at 0.5.x, pin the version in composer.json rather than using a floating constraint. Confirm your Laravel and PHP versions match the package's composer.json before installing or upgrading.
- How do I configure RabbitMQ connections, exchanges, and queues in Laravel?
- Define the broker connection details and the exchanges, queues, and bindings in the package configuration, using environment variables for host, port, credentials, and vhost. Consumers then bind to the configured exchange and queue when their Artisan command starts. Treat that broker topology as a startup dependency, because a missing exchange or binding can fail the worker before message handling begins.
- Which Laravel and PHP versions are supported by needle-project/laravel-rabbitmq?
- Check the package's composer.json for the supported Laravel and PHP version matrix before installing or upgrading. The package integrates through Laravel Artisan commands and the framework logging stack, so it depends on a compatible Laravel console and logging setup. At 0.5.x it is pre-1.0, so verify compatibility on every minor release rather than assuming semver stability.
- How do I publish a message to RabbitMQ from a Laravel app with this package?
- Use the package's AMQP API to publish a payload to a configured exchange with the appropriate routing key. Keep exchange and routing-key names in configuration so publishing code and consumer bindings stay aligned. Confirm your publisher and consumer share the same connection, vhost, and topology configuration.
- How do I create and run a RabbitMQ consumer worker in Laravel?
- Create an Artisan command for each consumer, typically by extending the package's BaseConsumerCommand, and configure it to bind to the exchange and queue it should consume. Run those commands as long-running supervised CLI processes, similar to how you run Laravel queue workers. In v0.5.1, binding failures are re-thrown so they reach Laravel's configured logging channels instead of appearing only on discarded worker output.
- What happens when a RabbitMQ exchange or binding is missing in laravel-rabbitmq v0.5.1?
- BaseConsumerCommand now re-throws the bind failure instead of letting it surface only on stdout or stderr, so the error falls through to Laravel's logging stack. That makes a misconfigured exchange visible in file, stderr, Sentry, CloudWatch, or other configured channels. Treat the error as a startup or configuration failure, not a message-processing failure, because it occurs before message handling. Verify that the command exits non-zero so supervisor or systemd sees the failure.
- How should I run laravel-rabbitmq consumers under supervisor in production?
- Run one supervised process per consumer Artisan command, capturing stderr and routing Laravel logs to a durable, monitored channel. Set deliberate startretries, autorestart, and backoff values so a bad exchange configuration does not create an unbounded crash-loop and log storm. Deduplicate alerts across worker processes, since each process can emit the same bind failure.
- Is needle-project/laravel-rabbitmq safe for production at version 0.5.x?
- It can be suitable for apps that need direct AMQP access, but 0.5.x is pre-1.0, so semver permits breaking changes in minor releases. Pin the version in composer.json and review each upgrade instead of floating the constraint. The v0.5.1 bind-failure logging change is low risk at the code level but changes process behavior in production, so stage and negative-test it first.
- How do I test RabbitMQ publishing and consuming in a Laravel app using this package?
- The package context does not describe a built-in fake, so plan on a disposable RabbitMQ broker for integration tests and wrap the package's publisher or consumer behind your own interfaces for unit tests. Include a negative test that points a consumer at a non-existent exchange and confirms the bind error reaches your log aggregator. Run that test in staging before promoting a version bump to production.
- What are alternatives to needle-project/laravel-rabbitmq for Laravel queues and AMQP?
- If you do not need direct AMQP access, Laravel's native queue workers with a supported queue backend may be simpler. If you need RabbitMQ, compare other community packages that integrate with Laravel's queue API, and choose based on whether you want queue-style jobs or direct exchange, routing-key, and consumer-command control. This package is aimed at apps that need direct AMQP access and can operate supervised consumer commands.