|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [1.1.0] - 2025-01-27 |
| 9 | + |
| 10 | +### 🚀 Major Advanced Features Added |
| 11 | + |
| 12 | +#### Dead Letter Exchange (DLX) |
| 13 | +- **Automatic DLX Setup**: Easy configuration for failed message handling |
| 14 | +- **Configurable TTL**: Message time-to-live settings |
| 15 | +- **Dead Letter Queues**: Automatic creation of DLQ for each queue |
| 16 | +- **Routing Key Control**: Custom routing for dead-lettered messages |
| 17 | +- **DLX Integration**: Seamless integration with existing queues |
| 18 | + |
| 19 | +#### Advanced Routing System |
| 20 | +- **ExchangeManager**: Comprehensive exchange management and routing |
| 21 | +- **Topic Exchanges**: Pattern-based message routing (e.g., `user.*.email`) |
| 22 | +- **Fanout Exchanges**: Broadcast messages to all bound queues |
| 23 | +- **Headers Exchanges**: Route based on message headers |
| 24 | +- **Exchange Bindings**: Flexible queue-to-exchange bindings |
| 25 | + |
| 26 | +#### Multi-Queue & Multi-Exchange Support |
| 27 | +- **Queue Configuration**: Define multiple queues with different settings |
| 28 | +- **Exchange Configuration**: Configure multiple exchanges with various types |
| 29 | +- **Lazy Queues**: Optimize memory for high-volume queues |
| 30 | +- **Priority Queues**: Support for message and consumer priorities |
| 31 | +- **Custom Arguments**: Full control over queue and exchange arguments |
| 32 | + |
| 33 | +#### Exponential Backoff Strategy |
| 34 | +- **ExponentialBackoff**: Intelligent retry mechanism with configurable parameters |
| 35 | +- **Jitter Support**: Prevents thundering herd problem with randomized delays |
| 36 | +- **Configurable Multiplier**: Customizable backoff progression |
| 37 | +- **Max Delay Cap**: Prevents excessive wait times |
| 38 | +- **Execute Helper**: Convenient wrapper for retry logic |
| 39 | + |
| 40 | +#### RPC (Remote Procedure Call) |
| 41 | +- **RpcClient**: Synchronous request-response pattern |
| 42 | +- **RpcServer**: Handle RPC requests with callbacks |
| 43 | +- **Correlation ID**: Automatic request-response matching |
| 44 | +- **Timeout Control**: Configurable timeout for RPC calls |
| 45 | +- **Reply Queue**: Automatic callback queue management |
| 46 | + |
| 47 | +#### Publisher Confirms |
| 48 | +- **Reliable Delivery**: Broker acknowledgment for published messages |
| 49 | +- **Confirm Mode**: Enable/disable publisher confirms |
| 50 | +- **Wait for Confirms**: Block until messages are confirmed |
| 51 | +- **Pending Tracking**: Track unconfirmed messages |
| 52 | +- **Timeout Control**: Configurable confirmation timeout |
| 53 | + |
| 54 | +#### Transaction Management |
| 55 | +- **AMQP Transactions**: Full transaction support |
| 56 | +- **Atomic Operations**: Commit/rollback for multiple operations |
| 57 | +- **Transaction Helper**: Convenient transaction wrapper |
| 58 | +- **Nested Transaction Prevention**: Safety checks for transaction state |
| 59 | +- **Error Handling**: Automatic rollback on exceptions |
| 60 | + |
| 61 | +#### Delayed Messages |
| 62 | +- **TTL-Based Delay**: Built-in delay using message TTL |
| 63 | +- **Plugin Support**: RabbitMQ delayed message exchange plugin |
| 64 | +- **Flexible Scheduling**: Schedule messages for future delivery |
| 65 | +- **Header-Based Delay**: x-delay header support |
| 66 | +- **Configurable Exchange**: Custom delayed exchange names |
| 67 | + |
| 68 | +### 🔧 Configuration Enhancements |
| 69 | + |
| 70 | +#### New Configuration Sections |
| 71 | +```php |
| 72 | +'backoff' => [ |
| 73 | + 'enabled' => true, |
| 74 | + 'base_delay' => 1000, |
| 75 | + 'max_delay' => 60000, |
| 76 | + 'multiplier' => 2.0, |
| 77 | + 'jitter' => true, |
| 78 | +], |
| 79 | + |
| 80 | +'exchanges' => [ |
| 81 | + 'default' => [...], |
| 82 | + 'notifications' => [...], |
| 83 | + // Custom exchanges |
| 84 | +], |
| 85 | + |
| 86 | +'queues' => [ |
| 87 | + 'default' => [...], |
| 88 | + 'high-priority' => [...], |
| 89 | + // Custom queues |
| 90 | +], |
| 91 | + |
| 92 | +'dead_letter' => [ |
| 93 | + 'enabled' => true, |
| 94 | + 'exchange' => 'dlx', |
| 95 | + 'exchange_type' => 'direct', |
| 96 | + 'queue_suffix' => '.dlq', |
| 97 | +], |
| 98 | + |
| 99 | +'delayed_message' => [ |
| 100 | + 'enabled' => false, |
| 101 | + 'plugin_enabled' => false, |
| 102 | +], |
| 103 | + |
| 104 | +'rpc' => [ |
| 105 | + 'enabled' => false, |
| 106 | + 'timeout' => 30, |
| 107 | +], |
| 108 | + |
| 109 | +'publisher_confirms' => [ |
| 110 | + 'enabled' => false, |
| 111 | + 'timeout' => 5, |
| 112 | +], |
| 113 | + |
| 114 | +'transactions' => [ |
| 115 | + 'enabled' => false, |
| 116 | +], |
| 117 | +``` |
| 118 | + |
| 119 | +#### New Environment Variables |
| 120 | +- `RABBITMQ_BACKOFF_ENABLED` - Enable exponential backoff |
| 121 | +- `RABBITMQ_BACKOFF_BASE_DELAY` - Base delay in milliseconds |
| 122 | +- `RABBITMQ_BACKOFF_MAX_DELAY` - Maximum delay in milliseconds |
| 123 | +- `RABBITMQ_BACKOFF_MULTIPLIER` - Delay multiplier |
| 124 | +- `RABBITMQ_BACKOFF_JITTER` - Enable jitter |
| 125 | +- `RABBITMQ_DLX_ENABLED` - Enable dead letter exchange |
| 126 | +- `RABBITMQ_DLX_EXCHANGE` - DLX exchange name |
| 127 | +- `RABBITMQ_DLX_EXCHANGE_TYPE` - DLX exchange type |
| 128 | +- `RABBITMQ_DLX_QUEUE_SUFFIX` - DLQ suffix |
| 129 | +- `RABBITMQ_DLX_TTL` - Message TTL in milliseconds |
| 130 | +- `RABBITMQ_DELAYED_MESSAGE_ENABLED` - Enable delayed messages |
| 131 | +- `RABBITMQ_DELAYED_PLUGIN_ENABLED` - Use delayed message plugin |
| 132 | +- `RABBITMQ_DELAYED_EXCHANGE` - Delayed exchange name |
| 133 | +- `RABBITMQ_RPC_ENABLED` - Enable RPC support |
| 134 | +- `RABBITMQ_RPC_TIMEOUT` - RPC timeout in seconds |
| 135 | +- `RABBITMQ_RPC_CALLBACK_PREFIX` - RPC callback queue prefix |
| 136 | +- `RABBITMQ_PUBLISHER_CONFIRMS_ENABLED` - Enable publisher confirms |
| 137 | +- `RABBITMQ_PUBLISHER_CONFIRMS_TIMEOUT` - Publisher confirms timeout |
| 138 | +- `RABBITMQ_TRANSACTIONS_ENABLED` - Enable transactions |
| 139 | + |
| 140 | +### 🛠️ API Enhancements |
| 141 | + |
| 142 | +#### New RabbitQueue Methods |
| 143 | +```php |
| 144 | +// Advanced queue declaration |
| 145 | +$queue->declareAdvancedQueue($name, $durable, $autoDelete, $lazy, $priority, $deadLetterConfig); |
| 146 | + |
| 147 | +// Exchange management |
| 148 | +$queue->getExchangeManager(); |
| 149 | +$queue->publishToExchange($exchange, $payload, $routingKey, $headers); |
| 150 | + |
| 151 | +// Backoff and retry |
| 152 | +$queue->getBackoff(); |
| 153 | + |
| 154 | +// Publisher confirms |
| 155 | +$queue->getPublisherConfirms(); |
| 156 | + |
| 157 | +// Transactions |
| 158 | +$queue->getTransactionManager(); |
| 159 | +$queue->transaction(callable $callback); |
| 160 | + |
| 161 | +// RPC |
| 162 | +$queue->getRpcClient(); |
| 163 | +$queue->rpcCall($queue, $message, $headers); |
| 164 | + |
| 165 | +// Dead letter exchange |
| 166 | +$queue->setupDeadLetterExchange($queueName, $dlxName, $dlxRoutingKey); |
| 167 | + |
| 168 | +// Delayed messages |
| 169 | +$queue->publishDelayed($queue, $payload, $delay, $headers); |
| 170 | +``` |
| 171 | + |
| 172 | +#### New Support Classes |
| 173 | +- `ExchangeManager` - Exchange and routing management |
| 174 | +- `ExponentialBackoff` - Retry logic with exponential backoff |
| 175 | +- `RpcClient` - RPC client implementation |
| 176 | +- `RpcServer` - RPC server implementation |
| 177 | +- `PublisherConfirms` - Publisher confirm handling |
| 178 | +- `TransactionManager` - Transaction management |
| 179 | + |
| 180 | +### 🔄 Breaking Changes |
| 181 | + |
| 182 | +None. All new features are opt-in and backward compatible. |
| 183 | + |
| 184 | +### 📦 Dependencies |
| 185 | + |
| 186 | +#### Requirements (Unchanged) |
| 187 | +- PHP 8.2+ |
| 188 | +- Laravel 11.x|12.x |
| 189 | +- ext-amqp |
| 190 | +- ext-pcntl |
| 191 | + |
| 192 | +--- |
| 193 | + |
| 194 | +## [1.0.0] - Previous Versions |
| 195 | + |
| 196 | +### Legacy Features |
| 197 | +- Basic RabbitMQ queue driver functionality |
| 198 | +- Connection pooling system |
| 199 | +- Channel management |
| 200 | +- Basic consumer commands |
| 201 | +- Standard Laravel Queue API integration |
0 commit comments