LaraRabbit v1.0.0 Release
We are excited to announce the initial release of LaraRabbit v1.0.0, a powerful and elegant RabbitMQ integration package for Laravel applications.
Overview
LaraRabbit provides a comprehensive solution for integrating RabbitMQ with Laravel, offering robust features for message queuing and event-driven architectures in microservices environments.
Features
- Simple, Expressive API: Intuitive interface for publishing and consuming messages
- Resilience Patterns: Circuit breaker and retry mechanisms to handle RabbitMQ outages gracefully
- Automatic Reconnection: Smart reconnection with exponential backoff and configurable retry limits
- Multiple Serialization Formats: Support for JSON and MessagePack serialization
- Message Validation: Schema validation for messages before publishing
- Dead Letter Queue Support: Built-in handling for failed messages
- Telemetry & Observability: Comprehensive logging and metrics
- Batch Processing Optimization: Efficient handling of large message batches with progress tracking
- Configurable Error Handling: Fine-grained control over error behavior
- Predefined Queues: Configure queues centrally and reuse them across your application
What's New
This initial release includes:
- RabbitMQ connection management with automatic reconnection and exponential backoff
- Consumer implementation with robust error handling
- Publisher implementation for reliable message delivery
- Support for topic, direct, and fanout exchange types
- Multiple serialization formats (JSON, MessagePack)
- Dead letter queue support for failed message handling
- Circuit breaker pattern implementation to prevent cascading failures
- Retry mechanisms with configurable attempts and delays
- Message validation against JSON schemas
- Comprehensive telemetry and performance monitoring
- Detailed error logging with context information
- Laravel Facade for easy integration with Laravel applications
- Auto-discovery of the service provider
- Predefined queues support with centralized configuration
- Event publishing with automatic metadata generation
- Batch processing with detailed progress tracking and statistics
Installation
composer require ahmedessam/lararabbit📜 Configuration Files
Publish the configuration file:
# Publish the main configuration file
php artisan vendor:publish --tag=lararabbit-config
# Publish the predefined queues configuration
php artisan vendor:publish --tag=lararabbit-queues-configThis will create a config/rabbitmq.php and config/rabbitmq-queues.php file with all general configuration options and predefined queue configurations.
📝 Usage Examples
- Basic Configuration
At a minimum, set these environment variables in your .env file:
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USER=guest
RABBITMQ_PASSWORD=guest
RABBITMQ_VHOST=/
RABBITMQ_EXCHANGE_NAME=my_applicationDocumentation
Full documentation is available in the repository:
- Getting Started
- Configuration
- Publishing Messages
- Consuming Messages
- Advanced Usage
- Error Handling
- Troubleshooting
Requirements
- PHP 8.2 or higher
- Laravel 9.0 or higher
- RabbitMQ server
License
The package is available as open-source under the terms of the MIT License.
Contributors
Support
If you encounter any issues or have questions, please open an issue in the GitHub repository.