commanded / commanded-extreme-adapter

Extreme event store adapter for Commanded
MIT License
12 stars 18 forks source link

Commanded.EventStore.Adapters.Extreme.EventStore missing from process registry #1

Closed feynmanliang closed 7 years ago

feynmanliang commented 7 years ago

I am trying to run a negligible variation of the example-domain (https://github.com/slashdotdash/commanded/tree/e96628253b70bec7ded3200e5efb6c2e0a6ebf19/test/example_domain) test from commanded using the extreme adapter, but am getting the following error:

iex(1)> Cqrs.Router.dispatch(%Cqrs.Commands.OpenAccount{account_number: "abc", initial_balance: 123})
[debug] starting aggregate process for `Cqrs.Domain.BankAccount` with UUID "abc"
{:error, :aggregate_execution_failed}
iex(2)> [error] GenServer {:aggregate_registry, "abc"} terminating
** (stop) exited in: GenServer.call(Commanded.EventStore.Adapters.Extreme.EventStore, {:execute, %Extreme.Msg.ReadStreamEvents{event_stream_id: "commandeddev-abc", from_event_number: 0, max_count: 100, require_master: false, resolve_link_tos: true}}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir) lib/gen_server.ex:729: GenServer.call/3
    lib/extreme.ex:265: Commanded.EventStore.Adapters.Extreme.execute_read/5
    lib/extreme.ex:58: anonymous fn/3 in Commanded.EventStore.Adapters.Extreme.stream_forward/3
    (elixir) lib/stream.ex:1257: Stream.do_resource/5
    (elixir) lib/stream.ex:1405: Enumerable.Stream.do_each/4
    (elixir) lib/stream.ex:785: Stream.do_transform/8
    (elixir) lib/enum.ex:1776: Enum.take/2
    (elixir) lib/stream.ex:642: anonymous fn/4 in Stream.take/2
Last message: {:"$gen_cast", {:populate_aggregate_state}}
State: %Commanded.Aggregates.Aggregate{aggregate_module: Cqrs.Domain.BankAccount, aggregate_state: nil, aggregate_uuid: "abc", aggregate_version: 0}
[error] Task #PID<0.324.0> started from #PID<0.321.0> terminating
** (stop) exited in: GenServer.call({:via, Registry, {:aggregate_registry, "abc"}}, {:execute_command, Cqrs.Handlers.OpenAccountHandler, :handle, %Cqrs.Commands.OpenAccount{account_number: "abc", initial_balance: 123}}, 5000)
    ** (EXIT) exited in: GenServer.call(Commanded.EventStore.Adapters.Extreme.EventStore, {:execute, %Extreme.Msg.ReadStreamEvents{event_stream_id: "commandeddev-abc", from_event_number: 0, max_count: 100, require_master: false, resolve_link_tos: true}}, 5000)
        ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir) lib/gen_server.ex:737: GenServer.call/3
    (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: &Commanded.Aggregates.Aggregate.execute/5
    Args: ["abc", %Cqrs.Commands.OpenAccount{account_number: "abc", initial_balance: 123}, Cqrs.Handlers.OpenAccountHandler, :handle, 5000]
slashdotdash commented 7 years ago

Looking at the error message is appears that the extreme connection process hasn't started. Which version of Elixir are you using? In 1.4 the dependencies to run are taken from the mix deps, and not explicitly defined.

I will take a look and try to find out what's going wrong for you.

feynmanliang commented 7 years ago

I was able to get past this by adding :commanded_extreme_adapter into mix.deps

  def application do
    # Specify extra applications you'll use from Erlang/Elixir
    [
      applications: [
        :logger,
        :commanded,
        :commanded_extreme_adapter
      ],
     mod: {Cqrs.Application, []}]
  end

However, I've run into another issue. I'll close this one and track that in a separate thread.