Skip to content

Generate message type enums #9

@marein

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).

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