Background
I'm using the EventStore (from geteventstore.com) in a project. So fare I have implemented the write side of the application. That is I can read and write events for a given aggregate.
Now i'm on the read side and need to subscribe to a stream. I'm using the java api and everything is also working here.
Now the problem
The stream doesn't exist... I have to create a projection that aggregates events from different streams to a single stream for my read model.
How can I create a projection via the api? Preferably with the java api, but the http api would also do.
Elaporates
As projections are the means for a readmodel to get the exact events it needs, new projections will be created as the business needs changes. My idea is therefore that a readmodel service will check for and potentially create the projection it needs when it starts up.
It will be unacceptable to manually create the projections before starting the service. That would be like manually migrating your sql db.