flix-tech/confluent-schema-registry-api
PHP 7.4+ client for Confluent Schema Registry REST API. Provides low-level PSR-7 request builders and higher-level synchronous/asynchronous APIs, with optional caching and Avro support via flix-tech/avro-php for easier schema management.
rdkafka or confluent-php-client). It enables schema validation, registration, and retrieval—critical for Avro/Protobuf-based event serialization in Laravel microservices or event-sourcing systems.HttpClient facade or GuzzleHttp\Client).guzzlehttp/promises).PromisingRegistry/BlockingRegistry into controllers, jobs, or commands.Doctrine\Cache, Psr\Cache, and Psr\SimpleCache—aligning with Laravel’s caching drivers (e.g., FileCache, RedisCache).flix-tech/avro-php, a maintained fork of rg/avro-php, which is critical for Laravel apps using Avro for Kafka/Serde serialization.confluent-php-client (for Kafka producer/consumer).php-kafka (alternative Kafka client).queue:work for async schema registration.guzzlehttp/promises) introduce callback hell if misused. Laravel’s sync-first paradigm may require wrappers (e.g., BlockingRegistry) for simplicity.App\Exceptions\Handler).spatie/flysystem-caching-driver) should be implemented.SchemaRegistryServiceProvider).SchemaRegistry facade for clean syntax (e.g., SchemaRegistry::register()).BlockingRegistry for sync operations (e.g., API routes, commands).PromisingRegistry + Laravel Queues for async operations (e.g., background schema validation).RedisCache) with DoctrineCacheAdapter.md5) or implement custom hashing (e.g., sha256).confluent-php-client for producer/consumer schema validation.$producer = new Producer(['schema.registry.url' => config('schema-registry.url')]);
$schemaId = SchemaRegistry::register('user-created-event', $avroSchema);
$producer->produce('topic', $record, ['schema.id' => $schemaId]);
Phase 1: Sync Integration
BlockingRegistry in Laravel’s service container.App\Services\SchemaService).php artisan test --env=testing).Phase 2: Async Workflows
BlockingRegistry with PromisingRegistry in job classes.queue:work to process promises (e.g., SchemaRegistrationJob).retryAfter in Guzzle middleware).Phase 3: Caching & Optimization
PromisingRegistry with CachedRegistry (e.g., Redis-backed).Phase 4: Kafka Integration
confluent-php-client for schema-aware producers/consumers.| Component | Compatibility | Mitigation |
|---|---|---|
| PHP 7.4+ | Laravel 8+ (PHP 7.4+), Laravel 7.x (PHP 7.3) may need upgrades. | Upgrade PHP or use a compatibility layer. |
| Guzzle 7.x | Laravel 9+ uses Guzzle 7; older versions may need guzzlehttp/guzzle:^7.0. |
Pin version in composer.json. |
| Avro Schema Parsing | Uses flix-tech/avro-php (fork of rg/avro-php). |
No action needed. |
| PSR-7 Requests | Laravel’s HttpClient or GuzzleHttp\Client can inject PSR-7 requests. |
Use HttpClient facade for consistency. |
| Caching Adapters | Supports Doctrine\Cache, Psr\Cache, Psr\SimpleCache. |
Use Laravel’s cache drivers (e.g., RedisCache). |
| Async Promises | Requires guzzlehttp/promises (v1 or v2). |
Laravel Queues can handle promise resolution. |
BlockingRegistry for sync use cases.PromisingRegistry in jobs.CachedRegistry with Laravel’s cache.confluent-php-client for schema-aware messaging.flix-tech/confluent-schema-registry-api for breaking changes (e.g., Guzzle 8+ support).flix-tech/avro-php if new Avro features are needed.CachedRegistry::invalidate()).SchemaRegistryException handling in Laravel’s App\Exceptions\Handler.How can I help you explore Laravel packages today?