Skip to content
Discussion options

You must be logged in to vote

@iancooper you are working on this for V10 right? for V9 do you have any suggestion?

I think you can use the mediator pattern, keep on message for subscription and send the command in message handler like

// Your current code
public class UserCreatedEvent : UserEvent { ... }

public class UserUpdatedEvent : UserEvent { ... }


public class UserMapper
{
    public UserEvent MapToRequest(Message message)
    {
        var requestType = GetHeaderValue(message, "RequestType");
        var json = message.Body.Value;

        return requestType switch
        {
            "UserCreated" => JsonSerializer.Deserialize<UserCreatedEvent>(json),
            "UserUpdated" => JsonSerializer.Deserialize<

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by attilabotz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants