Download the PHP package jardisadapter/messaging without Composer
On this page you can find all versions of the php package jardisadapter/messaging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jardisadapter/messaging
More information about jardisadapter/messaging
Files in jardisadapter/messaging
Package messaging
Short Description Multi-transport messaging for Redis, Kafka, RabbitMQ, and Database with automatic serialization, consumer groups, and failover
License MIT
Homepage https://docs.jardis.io/en/adapter/messaging
Informations about the package messaging
Jardis Messaging
Part of the Jardis Business Platform — Enterprise-grade PHP components for Domain-Driven Design
Multi-transport messaging with a unified API for Redis, Kafka, RabbitMQ, Database, and InMemory. ConnectionFactory creates transport-specific connections; PublisherFactory and ConsumerFactory produce typed publishers and consumers from those connections. MessagePublisher and MessageConsumer are immutable facades that accept one or more transport instances via constructor injection and provide automatic serialization, priority-based failover, and graceful shutdown.
Features
- 4 Transports + InMemory — Redis (Pub/Sub and Streams), Kafka, RabbitMQ, Database (PDO), InMemory (testing)
- Unified Publish/Consume API —
publish(topic, message)andconsume(topic, handler)across all transports - Immutable Facades —
MessagePublisherandMessageConsumervia variadic constructor injection - Automatic Serialization — Arrays and objects encoded to JSON on publish, decoded transparently on consume
- Consumer Groups — Redis Streams and Kafka for horizontal scaling
- Priority Failover — Constructor order determines priority; first healthy transport wins
- Lazy Connection —
MessagingServicedefers publisher and consumer creation until first use - Database Transport — PDO-based messaging with Point-to-Point and Fan-Out modes, no external broker required
- External Connections — Wrap existing Redis, PDO, AMQP, or Kafka clients via
ConnectionFactory::from*() - Message Validation — Payload validation before transmission via
MessageValidator - Graceful Shutdown — SIGTERM/SIGINT handling enabled automatically on
consume()
Installation
Optional extensions (install only what you need):
ext-redis— Redis Streams/Pub-Sub transportext-rdkafka— Apache Kafka transportext-amqp— RabbitMQ transport
PDO (Database transport) is always available via ext-pdo.
Quick Start
Priority Failover
Constructor order determines priority — first argument is tried first. On MessageException, the next transport is used automatically.
Transports
Redis
Supports both Pub/Sub (default) and Streams mode.
Kafka
Separate connection types for producer and consumer. Consumer group ID is configured on the connection.
RabbitMQ
Queue-based messaging with automatic ACK/NACK handling.
Database (PDO)
No external broker required — uses the application's existing database. Supports MySQL, PostgreSQL, and SQLite.
Schema: src/Schema/domain_events.sql
InMemory (Testing)
Synchronous in-memory transport for unit and integration tests.
External Connections
Wrap existing connections from legacy systems, DI containers, or frameworks.
When manageLifecycle: false, disconnect() is a no-op — the external system owns the connection lifecycle.
MessagingService (Lazy Loading)
Defers publisher and consumer creation until first use. Ideal for DI containers.
Error Handling
All exceptions extend MessageException:
| Exception | When |
|---|---|
ConnectionException |
Connection fails, getClient() called without connect() |
PublishException |
Publishing fails, serialization error, validation failure |
ConsumerException |
Consumer initialization or polling fails |
Publisher fallback only triggers on MessageException — other exceptions propagate immediately.
Consumer state-cleanup is performed before re-throwing: NACK in RabbitMQ, attempt tracking in Database, requeue in InMemory.
Documentation
Full documentation, guides, and API reference:
docs.jardis.io/en/adapter/messaging
License
This package is licensed under the MIT License.
Jardis · Documentation · Headgent
KI-gestützte Entwicklung
Dieses Package liefert einen Skill für Claude Code, Cursor, Continue und Aider mit. Installation im Konsumentenprojekt:
Mehr Details: https://docs.jardis.io/en/skills
All versions of messaging with dependencies
ext-pcntl Version *
ext-pdo Version *
jardissupport/contract Version ^1.0