Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.3-incubating
-
None
Description
We currently have a pretty complex fluent API for our message stuff. Imo a bit too fluent. The main focus is on always creating immutable objects, but this causes quite some overhead. In fact, the MessageContext itself is always being created as @Dependent scoped bean, thus chances to modify a MessageContext in concurrent manner is not high. Thus we could easily merge MessageContext with MessageContext.Config - we just need to make people aware that they change the MessageContext itself with the fluent API (builder pattern). We can also add a cloneContext() method which will create a new instance based on the current configuration.
The same simplification can be done with MessageBuilder with Message. It doesn't make much sense to distinct between a MessageBuilder#addArguments(...) and Message#addArguments(...). They really do the same.