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

Individual stream events handling #555

Open
maslowalex opened this issue Apr 3, 2024 · 0 comments
Open

Individual stream events handling #555

maslowalex opened this issue Apr 3, 2024 · 0 comments

Comments

@maslowalex
Copy link

maslowalex commented Apr 3, 2024

Please help me to understand how to handle events from individual streams. I'm been using Commanded for more than a year now, but still it's really hard for me to understand how to do this simple thing.

I got this in my router:

  identify(Aggregates.Identity, by: :hashed_identity, prefix: "identity-")

  dispatch(Commands.Login, to: Aggregates.Identity)

Then in EventHandler:

  use Commanded.Event.Handler,
    application: MyApp.App,
    name: __MODULE__,
    start_from: :origin,
    subscribe_to: "identity"

Upon dispatching of the command I can see the identity- prefix in the stream_id field, like: identity-zRcB77sjpxcD8Hh9pWjq4_g5Pf3KU5g_pPxqRzcxsLQ=

The aforementioned event handler does not receiving the event.

I was trying to append the stream_id (stream_uuid what is difference btw, it's so confusing...) to the command itself when I dispatching it, but that doesn't help either:

App.dispatch(stream_id: "identity")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant