Skip to content

Generate message type enums #9

Closed

Description

@marein

Currently, message types are hard-coded by publishers and consumers. This is error prone and needs alignment between sender and receiver. To improve this, an enum (or constants) per domain and version should be generated for all supported languages, like with the generated factories.

Examples for PHP:

enum ConnectFourV1Type: string
{
    case JoinGame = 'ConnectFour.JoinGame';

    case GetGamesByPlayer = 'ConnectFour.GetGamesByPlayer';
}
enum ConnectFourV2Type: string
{
    case JoinGame = 'ConnectFour.JoinGame.v2';

    case GetGamesByPlayer = 'ConnectFour.GetGamesByPlayer.v2';
}

As shown in the example, the version may be omitted in V1 because of backwards compatibility (but not necessary, since the app isn't running somewhere).

Activity

  1. linked a pull request that will close this issueGenerate message type enums #10on Dec 6, 2025
  2. self-assigned this
    on Dec 6, 2025
  3. added a commit that references this issue on Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions