dekalee/pubsub-swarrot-bundle
swarrot-pubsub to integrate Pub/Sub messaging into SwarrotBundle, a Laravel/Symfony-like event system. This aligns well with Laravel’s event/queue ecosystem (e.g., Illuminate\Bus, Illuminate\Queue), particularly for asynchronous event handling or decoupled service communication.spatie/laravel-symfony-bundle). Risk: Laravel’s ecosystem prefers standalone packages over bundles.Queue interfaces.AppKernel.php, config.yml). Laravel uses config/app.php and service providers.swarrot-pubsub into Laravel’s event system via listeners or queue workers.ServiceProvider instead of Bundle).swarrot-pubsub logic.queue or events systems if not carefully namespaced.queue or events systems. Could introduce unexpected latency if Pub/Sub is overkill for the use case.queue system may suffice.queue?queue with failed_jobs table or third-party packages like spatie/laravel-queue-pubsub?swarrot-pubsub or this bundle becomes unmaintained?redis, database)?queue:work?queue system has built-in tools for this.AppKernel.php).config/app.php instead of config.yml).Illuminate\Events\Dispatcher and Illuminate\Queue).queue instead).symfony/* packages if Laravel’s illuminate/* equivalents are already loaded.| Step | Action | Laravel Adaptation Notes |
|---|---|---|
| 1 | Install | composer require dekalee/pubsub-swarrot-bundle (but expect Symfony dependencies). |
| 2 | Configure | Replace config.yml with Laravel’s config/swarrot.php (manual mapping required). |
| 3 | Register Bundle | Create a Laravel Service Provider to bootstrap the bundle’s services. Example: |
| ```php | ||
| use Dekalee\PubSubSwarrotBundle\DependencyInjection\DekaleePubSubSwarrotExtension; | ||
| use Symfony\Component\DependencyInjection\ContainerBuilder; |
class PubSubSwarrotServiceProvider extends ServiceProvider { public function register() { $this->mergeConfigFrom(DIR.'/../config/swarrot.php', 'swarrot'); $this->app->register(DekaleePubSubSwarrotBundle::class); } }
| 4 | **Integrate with Laravel Events** | Extend Laravel’s `Event` facade to use the Pub/Sub provider. Example: |
| ```php
// In a listener or service
use Dekalee\PubSubSwarrotBundle\PubSub\PubSubProvider;
class MyEventListener {
protected $pubSub;
public function __construct(PubSubProvider $pubSub) {
$this->pubSub = $pubSub;
}
public function handle(MyEvent $event) {
$this->pubSub->publish('event.occurred', $event->toArray());
}
}
``` |
| 5 | **Queue Workers** | Use Laravel’s `queue:work` but ensure the Pub/Sub consumer is registered as a queue driver. May require a **custom queue connection**. |
| 6 | **Testing** | Write integration tests to verify Pub/Sub messages are published/consumed correctly. |
### **Compatibility**
- **Symfony vs. Laravel**:
- **Breaking**: `AppKernel.php`, `config.yml`, and bundle autoloading won’t work out-of-the-box.
- **Mitigation**: Abstract Symfony-specific code into a **separate layer** or fork the bundle.
- **Laravel Queue System**:
- **Conflict Risk**: If the bundle expects to replace Laravel’s queue system, conflicts may arise. **Recommend**: Use it **alongside** Laravel’s queue (e.g., for specific async event types).
- **PHP Version**: Check compatibility with Laravel’s PHP version (e.g., 8.0+). The bundle may lag behind.
### **Sequencing**
1. **Proof of Concept (PoC)**:
- Test the bundle in a **non-production Laravel app** to validate Pub/Sub functionality.
- Measure **latency** vs. Laravel’s native `queue`.
2. **Bridge Development**:
- If gaps are found, develop a **Laravel-specific adapter** layer.
3. **Incremental Rollout**:
- Start with **non-critical events** to monitor stability.
- Gradually migrate **high-priority async workflows**.
4. **Fallback Plan**:
- Document how to **revert to Laravel’s queue** if issues arise.
---
## Operational Impact
### **Maintenance**
- **Short-Term**:
- **High effort**: Requires **custom integration code** to bridge Symfony/Laravel.
- **Dependency risks**: If `swarrot-pubsub` or this bundle breaks, Laravel may also fail.
- **Long-Term**:
- **Ongoing maintenance**: The team must monitor **upstream changes** and adapt.
- **Forking risk**: If the bundle is abandoned, the team may need to **maintain a fork**.
- **Tooling**:
- **No Laravel-specific tooling**: Missing integration with Laravel Forge, Envoyer, or Homestead.
- **Debugging**: Symfony’s error formats may not align with Laravel’s (e.g., `Whoops` vs. `Symfony ErrorHandler`).
### **Support**
- **Community**:
- **Nonexistent**: No stars/issues mean **no community support**.
- **Workarounds**: Team will rely on **Symfony documentation** or reverse-engineering.
- **Vendor Lock-in**:
- Tied to **dekalee’s maintenance cycle**. No SLAs or guarantees.
- **Laravel Ecosystem**:
- **Limited plugins**: No Laravel-specific monitoring (e.g., Laravel Debugbar) or IDE support (e.g., PHPStorm plugins).
### **Scaling**
- **Performance**:
- **Unknown**: No benchmarks. Could introduce **bottlenecks
How can I help you explore Laravel packages today?