Download the PHP package robertbaelde/persisting-message-bus without Composer
On this page you can find all versions of the php package robertbaelde/persisting-message-bus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package persisting-message-bus
Persisting message bus
This package will provide a message bus that persists its messages. This can be used for cross context communication with public events. The message bus will be for a topic. A topic is a set of event types.This allows for the consuming context to only know about the topic and its event types, and not where they originate from.
Installation
Usage
Configuring a topic
A topic is a set of message classes, mapped to a string name. Each topic must have a unique name.
Messages must implement the PublicMessage interface
Dispatching messages
In order to dispatch messages you'll need a message bus. This can be constructed using a topic and a message repository.
With this topic you are able to construct a MessageDispatcher, which can be used to dispatch messages. Message dispatchers can decorate messages using a MessageDecorator.
Consuming messages
In order to consume messages you'll need a message bus and a repository that keeps track of your offset to the message stream. Eventsauce's message consumers can be used as consumers.
When using a message consumer you might want to run handleNewMessages in a loop. Make sure only one process is handling new messages at a time. Otherwise messages might be handled double.
Illuminate repositories
In order to persist messages and consumer state 2 repositories are provided.
Database scheme for messages:
Database scheme for consumers:
Roadmap
- [ ] Add a consumer that makes http requests for cross service sync
- [ ] Add system for Correlation & Causation id's?
- [ ] Message inbox pattern
- [ ] Message outbox pattern
License
The MIT License (MIT). Please see License File for more information.
All versions of persisting-message-bus with dependencies
ramsey/uuid Version ^4
illuminate/database Version ^8|^9|^10
eventsauce/backoff Version ^1.1