Thibaud
c4477aca38
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.
39 lines
1.3 KiB
XML
39 lines
1.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<groupId>fr.gasser</groupId>
|
|
<artifactId>java-cookbook</artifactId>
|
|
<version>1.0-SNAPSHOT</version>
|
|
<packaging>pom</packaging>
|
|
|
|
<modules>
|
|
<module>reflection</module>
|
|
<module>gui</module>
|
|
<module>async</module>
|
|
<module>lang</module>
|
|
<module>persistence</module>
|
|
<module>messaging</module>
|
|
</modules>
|
|
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<maven.compiler.source>1.11</maven.compiler.source>
|
|
<maven.compiler.target>1.11</maven.compiler.target>
|
|
<slf4j.version>1.7.28</slf4j.version>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-api</artifactId>
|
|
<version>${slf4j.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-simple</artifactId>
|
|
<version>${slf4j.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
</project> |