You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flusswerk encourages implementation of custom messages that fit the respective applications. For a quick start, a DefaultMessage class is provided that has an String id and da Map<String, String> data.
This approach has several drawbacks:
Overuse of DefaultMessage in applications
There have are many applications where Developers use the HashMap<String, String> of DefaultMessage instead of a custom implementation, not only losing type safety and type information, but also revert to frequent String parsing and String comparison.
A custom message implementation also has a simpler JSON structure which greatly improves debugging and testing .
Mistaken use inside the Framework
The existence of DefaultMessage can be misleading on the Framework development itself, as to the confusing error handling implementation when receiving a message fails where a DefaultMessage is constructed, mimicking a broken message of arbitrary type:
Remove DefaultMessage and require a custom message implementation. Almost all usage is only in examples and tests where a suitable implementation can be provided. For easy implementation of custom messages, the abstract FlusswerkMessage can be used (also TraceableMessage, see #147).
The text was updated successfully, but these errors were encountered:
bitzl
changed the title
DefaultMessage
Remove DefaultMessage
Apr 3, 2020
Problem
Flusswerk encourages implementation of custom messages that fit the respective applications. For a quick start, a DefaultMessage class is provided that has an
String id
and daMap<String, String> data
.This approach has several drawbacks:
Overuse of
DefaultMessage
in applicationsThere have are many applications where Developers use the
HashMap<String, String>
ofDefaultMessage
instead of a custom implementation, not only losing type safety and type information, but also revert to frequent String parsing and String comparison.A custom message implementation also has a simpler JSON structure which greatly improves debugging and testing .
Mistaken use inside the Framework
The existence of
DefaultMessage
can be misleading on the Framework development itself, as to the confusing error handling implementation when receiving a message fails where aDefaultMessage
is constructed, mimicking a broken message of arbitrary type:flusswerk/engine/src/main/java/de/digitalcollections/flusswerk/engine/messagebroker/RabbitClient.java
Lines 117 to 122 in 5b08998
Solution
Remove
DefaultMessage
and require a custom message implementation. Almost all usage is only in examples and tests where a suitable implementation can be provided. For easy implementation of custom messages, the abstractFlusswerkMessage
can be used (alsoTraceableMessage
, see #147).The text was updated successfully, but these errors were encountered: