simple-bus/jms-serializer-bridge
Bridge for SimpleBus Serialization that implements the ObjectSerializer interface using JMSSerializer. Use it to serialize and deserialize message objects in SimpleBus-based applications with a familiar JMS Serializer backend.
database driver) or external message brokers (e.g., RabbitMQ via SimpleBus).@SerializedName to enforce consistent field naming across microservices.json_encode, this bridge abstracts serialization logic from business objects, improving testability and maintainability (e.g., swap JSON for XML without changing domain code).spatie/laravel-simple-bus), this bridge integrates seamlessly. For pure Laravel, it can still be used via a custom adapter.SimpleBus\Serialization\Serializer to JMSSerializer). Consider creating a Laravel-specific facade (e.g., BusSerializer) to simplify usage.Carbon instances or Eloquent models without custom handlers. Requires explicit configuration (e.g., YAML metadata or PHP attributes).serialize(). Overriding this requires a custom queue payload serializer (e.g., via Illuminate\Queue\QueueManager events).jms/serializer (e.g., API Platform). Use Composer’s replace or aliases to manage versions.json_encode may resist the abstraction.json_encode for simple objects but comparable for complex graphs. Benchmark with your actual message payloads.// Fails without configuration:
$serializer->serialize(new User());
@Serializer\Type → @Type in JMSSerializer 3.shouldRetry() in failed jobs.spatie/array-to-object, msgpack-php) achieve the same goals with less overhead?json_encode for your actual message payloads?metadata.cache_dir) to reduce runtime overhead?serialize() in job payloads with ObjectSerializer. Requires a custom queue payload serializer (see "Sequencing" below).Illuminate\Contracts\Events\Dispatcher.simple-bus/simple-bus).Phase 1: Proof of Concept (1–2 weeks)
simple-bus/jms-serializer-bridge and jms/serializer to composer.json.json_encode($object) with $serializer->serialize($object) in a single job/event.Phase 2: Gradual Rollout (2–4 weeks)
Phase 3: Full Adoption (1–2 weeks)
json_encode-based serialization paths.serialize() (e.g., afterCommit() hooks).ObjectSerializer.Serializer interface.How can I help you explore Laravel packages today?