comsave/safe-salesforce-saver-bundle
Architecture fit
The comsave/safe-salesforce-saver-bundle is a Symfony-specific package designed to decouple Salesforce API calls from immediate execution via RabbitMQ queues, ensuring reliability for bulk operations. While Laravel lacks native Symfony bundle support, its queue system (database/Redis) and event-driven architecture can replicate this pattern. The package’s core value—asynchronous, retry-capable Salesforce writes—aligns with Laravel’s queue:work and dispatch() paradigms. The RabbitMQ dependency is the primary misalignment; Laravel’s native queue drivers (e.g., redis, database) would require abstraction.
Integration feasibility
old_sound_rabbit_mq (Symfony bundle) → Replace with Laravel’s php-amqplib or vladimir-yuldashev/laravel-queue-rabbitmq.EventDispatcher → Laravel’s Illuminate\Events.salesforce-mapper-bundle (Symfony) for object serialization. Laravel alternatives like spatie/laravel-salesforce or custom mappers would need adaptation.Technical risk
queue:work) to process RabbitMQ messages.SalesforceQueueService).failed_jobs table vs. RabbitMQ monitoring).Key questions
Stack fit
Illuminate\Queue with a custom RabbitMQ driver (e.g., vladimir-yuldashev/laravel-queue-rabbitmq).SafeSalesforceSaver as a singleton).Event facade.Migration path
SalesforceQueueService) to wrap the bundle’s core logic (e.g., save(), aSyncSave()).class SalesforceQueueService {
public function save($object) {
$symfonySaver = app(SafeSalesforceSaver::class);
return $symfonySaver->save($object);
}
}
config/queue.php).old_sound_rabbit_mq config with Laravel’s queue worker setup:
'connections' => [
'rabbitmq' => [
'driver' => 'rabbitmq',
'host' => env('RABBITMQ_HOST'),
'queue' => 'sss_async_queue',
'options' => [
'prefetch_count' => 1,
],
],
],
php-amqplib in-memory queues).Compatibility
Sequencing
aSyncSave) for low-priority operations during rollout.laravel-queue-monitor) before full adoption.Maintenance
rabbitmqctl list_queues).queue:failed table to include Salesforce-specific errors.Support
README.md section detailing queue setup and error handling.failed_jobs table for exception fields."purge_queue for testing).Scaling
prefetch_count: 10) to balance throughput.queue:work processes (Laravel’s supervisor config).queue:listen vs. queue:work to compare resource usage.Failure modes
| Scenario | Impact | Mitigation |
|---|---|---|
| RabbitMQ broker downtime | All async Salesforce writes fail | Fallback to synchronous calls with circuit breaker. |
| Queue worker crashes | Unprocessed messages pile up | Use Laravel’s afterCommit hook to retry failed jobs. |
| Salesforce API throttling | Retries exhaust quotas | Implement exponential backoff in the queue worker. |
| Custom object mapping errors | Messages stuck in queue | Validate objects with a pre-save hook. |
Ramp-up
php-amqplib, broker access).How can I help you explore Laravel packages today?