Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a prefix to the aggregate in the router breaks the strong consistency of the router #101

Closed
tcoopman opened this issue Oct 29, 2017 · 2 comments
Assignees

Comments

@tcoopman
Copy link

When you add a prefix to an AggregateRoot in the Router:

  defmodule ConsistencyRouter do
    use Commanded.Commands.Router

    identify ConsistencyAggregateRoot,
        by: :uuid,
        prefix: "some-prefix"

    dispatch [ConsistencyCommand,NoOpCommand,RequestDispatchCommand],
      to: ConsistencyAggregateRoot
  end

and then try to use Router.dispatch(..., consistency: :strong) it never returns :ok, but always {:error, :consistency_timeout}. You can easily test this in the dispatch_consistency_test.exs

@slashdotdash
Copy link
Member

Thanks for the bug report @tcoopman, I will take a look. Expect it to be a straightforward fix - the consistency check is using the aggregate_uuid, which in the case of using a prefix will be different from the actual stream_uuid used to persist its events.

@slashdotdash
Copy link
Member

Fixed, will be available in the next release of Commanded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants