Commit Graph

4 Commits

Author SHA1 Message Date
c5ea09d09d messaging/broker : update handlers 2020-03-15 19:19:05 +01:00
e407698e84 Adds DI and SPI examples 2020-03-15 18:59:33 +01:00
9f120b6317 messaging/broker : update test cases
See c4477aca38
2020-01-27 21:53:07 +01:00
c4477aca38 messaging: add a simple message broker
Add a simple message broker which uses the chain of responsibility design pattern for
message handling.

Inspired by this article: http://www.softwarematters.org/message-broker.html#java-implementation

In this design, a message handler can contain a reference to the next
message handler. If the current handler cannot handle the message given
to him by the MessageBroker, he passes this message to the next
MessageHandler.

The chain of responsibility pattern is used in order to decouple the creation of a
concrete message instance from the broker communication logic. This adheres to the Open
Closed Principle, because it is possible to add a new message type without modifying the
message broker.
2019-10-19 17:48:53 +02:00