mateusjunges/confluent-schema-registry-api
PHP 7.4+ client for Confluent Schema Registry REST API. Offers low-level PSR-7 request builders plus high-level async/sync abstractions, with optional caching support. Built on Guzzle and Avro PHP for schema handling.
Event-Driven & Schema Management Alignment:
laravel-kafka) by ensuring schema compatibility across producers/consumers.Microservices & API Layer Fit:
v1/v2 of a user_created event schema).Laravel Ecosystem Synergy:
Data Governance:
spatie/laravel-activitylog by recording schema registry changes.Laravel Stack Compatibility:
Illuminate\Http\Client (PSR-18) or Guzzle.php-avro or google/protobuf for schema serialization.Database & Caching:
migrations or spatie/laravel-medialibrary-style tables.Async/Sync APIs:
registerSchema() in a delayed job).GET /schemas/{subject}).Error Handling:
SchemaRegistryException can be mapped to Laravel’s App\Exceptions\Handler for consistent error responses.| Risk Area | Mitigation Strategy |
|---|---|
| Schema Registry Downtime | Implement circuit breakers (e.g., spatie/laravel-circuit-breaker) for retries. |
| Avro/Protobuf Complexity | Use Laravel’s service containers to abstract schema parsing (e.g., AvroSchema::parse()). |
| Caching Invalidation | Leverage Laravel Events (e.g., SchemaUpdated) to invalidate cache. |
| Version Skew | Enforce schema compatibility checks in Laravel middleware (e.g., ValidateSchema). |
| Performance Overhead | Benchmark cached vs. uncached registry calls; use PromisingRegistry for async ops. |
Schema Registry Hosting:
Schema Evolution Strategy:
COMPATIBILITY_BACKWARD).SchemaRegistryException handlers.Laravel Integration Depth:
Monitoring & Alerts:
Testing Strategy:
Laravel Core:
PromisingRegistry/BlockingRegistry as a singleton.schema_registry config (e.g., config/schema_registry.php) for base URI, cache, and retries.SchemaRegistry facade for clean syntax (e.g., SchemaRegistry::register('user', $schema)).HTTP Layer:
ValidateSchemaMiddleware to validate incoming/outgoing Kafka/Avro payloads.spatie/laravel-api-resources to serialize schemas in API responses.Queues/Jobs:
PromisingRegistry for async schema operations (e.g., SchemaRegistrationJob).SchemaRegistryException in Illuminate\Bus\Queueable.Caching:
DoctrineCacheAdapter for schema ID caching.schemas table (subject, version, Avro/Protobuf payload).Phase 1: Low-Risk Integration
composer.json and configure in config/schema_registry.php.Phase 2: Async & Caching
PromisingRegistry in queues.CachedRegistry with Redis caching.Phase 3: Governance & Monitoring
| Component | Compatibility Notes |
|---|---|
| Laravel 9/10 | Full compatibility (PHP 8.1+). |
| Guzzle 7+ | Default in Laravel 10; no conflicts. |
| Avro/Protobuf | Requires flix-tech/avro-php or google/protobuf. |
| Doctrine Cache | Works with Laravel’s cache drivers (Redis, database). |
| PSR-7/PSR-18 | Interoperable with Laravel’s HTTP client. |
| Kafka Clients | Works with rdkafka, confluent-php-client, or php-kafka. |
Prerequisites:
guzzlehttp/guzzle, beberlei/assert, and flix-tech/avro-php.Core Integration:
SchemaRegistryServiceProvider.BlockingRegistry for synchronous operations.Async & Caching:
PromisingRegistry.CachedRegistry with Redis.Validation & Monitoring:
Testing:
SchemaRegistry facade.Dependency Updates:
guzzlehttp/promises (v2.0+), avro-php, and beberlei/assert for breaking changes.roave/security-advisories to track vulnerabilities.Schema Registry Updates:
UPGRADE.md from the package for major version changes.Caching Strategy:
cache()->forget() or Redis DEL commands.How can I help you explore Laravel packages today?