Comments (9)
I've been looking for this option, too, encountering a couple of cases where I'd like to subscribe to all Events for a specific Aggregate type. I'm not sure whether this would be more of an EventStore issue that a Commanded issue, though... (as in: you may want to have a stream_type
(aggregate type) registered with each stream, enabling per-type subscriptions on the EventStore level).
from commanded.
@florish I'm using Greg's ES, where it is already available: http://codeofrob.com/entries/creating-a-projection-per-stream-in-the-eventstore.html
from commanded.
@florish Both Greg's Event Store and my own Elixir EventStore support subscriptions to a single stream. But only Greg's Event Store supports category subscriptions (e.g. by event type).
Commanded could allow the user to configure the stream that a handler, or process manager, subscribes to as in the example below:
defmodule ExampleEventHandler do
use Commanded.Event.Handler,
name: "ExampleEventHandler",
subscribe_to: "$ce-cars"
end
This would be optional, the default would be the current behaviour (subscribe all events).
from commanded.
@slashdotdash @drozzy Thanks both! Good to know about the available options.
from commanded.
I think the $ce-cars
behaviour should be the default. I practically never subscribe to single stream (commanded handles it for me automatically for aggregates!)
So it looks like internal implementation leaking into user layer.
By the way, this is the only feature that commanded is missing for me not to use Extreme alongside it.
from commanded.
@drozzy Using $ce-cars
as a default wouldn't work with anything other than Greg's ES, would it?
AFAIK the Postgres-backed Eventstore (commanded/eventstore) would not be able to use that default since it does not have category streams ATM, or am I mistaken here?
from commanded.
Sorry, I'm not familiar with Postgres-ES :-(
from commanded.
Not a problem at all, in essence there is no such thing as category streams in there yet (I'm not aware whether there is interest in building something along these lines). So right now, if Commanded is going to support pluggable backends, it'd be necessary to subscribe to $all
since that's the only stream that is guaranteed to be supported by all backends.
Apart from that, totally agreed with your point, it'd be super nice for scalability as well.
from commanded.
@jfornoff the notion of "categories" is what makes the stream model per-aggregate so powerful. For example, if you have a page that lists "cars", how would you get cars from different aggregates into one projection? I suppose if you could query the DB directly (and if that DB did projections for you) that would solve the issue. But ES.org is remote service, and you can't build large projections and then query them.
I find, in general, that ES guys know what they are doing in terms of Event Sourcing, and I've been actually learning about the right way of doing things just by using their product (for example, their competing consumers implementation teaches you that you must ack everything, as opposed to how I though it would work magically).
from commanded.
Related Issues (20)
- Update sponsors in BACKERS and README HOT 1
- General design philosophy question: sending email from process manager HOT 4
- update FAQ regarding scheduling HOT 1
- Wiki Testing section is outdated HOT 1
- warning: redefining module Commanded.Serialization.JsonDecoder.Any HOT 2
- Event number gaplessness required?
- Commanded.aggregate_state does not work when aggregate identity has a prefix HOT 10
- Process manager router option not working
- Lessons learned from performance optimization - an unlikely culprit HOT 3
- no function clause matching in Commanded.Commands.Dispatcher.telemetry_stop/3 HOT 1
- Docs questions
- Stacktrace in event handler error? HOT 2
- Paralelization Strategies in EventHandlers
- Should Commanded.Event.Handler support messages from swarm? HOT 2
- Event retention policies?
- please support multiple commanded application with one eventstore HOT 6
- Process Manager state serialization breaks when using a custom TypeProvider with the JsonSerializer
- `Commanded.ProcessManagers.ProcessManager.identity/0` function returns `nil` in unit tests
- no function clause matching in Commanded.Event.Handler.partition_event/4 HOT 1
- EventstoreDB is sunsetting the TCP protocol HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commanded.