core-java
core-java copied to clipboard
Rework `MessageId`
As the analysis of this code related to this issue (#1189) reveals, the MessageId
type and the code around it is puzzling. The name of the type conflicts with what we have already in the framework language. We have already CommandId
, and EventId
. Also, we promote typed entity IDs. And when the public API shows also MessageId
, it raises a question: “What the hell is this? Why do you need it, and why do I need to know about it?”
More, the “guts” of the type are more than ID: we have type URL of the identified message, as well as the version. Sometimes, MessageId
produces a copy of itself with a newer version. We definitely need a better name.
Also, exposure of MessageId
to the client API (via EventContextMixin
) is unnecessary. Presumably, the MessageId
types serves for diagnostics, and as such should be isolated to the servers-side code.