JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.87k stars 457 forks source link

Marten with Wolverine and RabbitMQ, Fundamental misunderstanding on Projections? #3565

Closed NeussConsulting closed 2 days ago

NeussConsulting commented 2 days ago

Hi,

I use Marten with Wolverine and RabbitMQ and currently I'm in fear that I have a fundamental misunderstanding, because I try since hours something to achive what does not work.

I have two applications, let's call them Worker and Brain and a Domain Lib with one Event "WorkerStarted" which is shared between them.

The Worker application is putting this event into the RabbitMQ queue with MessageBus.PublishAsync.

Then I have the Brain listening on that Queue, till this point everything works great.

But now comes my issue, I want to use the Projection feature of Marten, for example FlatTableProjection or EventProjection. BUT this projections have nothing to to with aggregates! I also have projections based on Aggregates and their events (And they work like expected)

So, I just want to create tables in the connected Postgres DB with the Marten Projection feature based on events.

Is it possible, that this is not possible at all, because there are to many assumptions in the Marten framework with Id's and Versions and what not.

That would be a pitty ;(

jeremydmiller commented 2 days ago

@NeussConsulting Hey, could you please use Discord for questions instead of GitHub issues please? Try here: https://discord.gg/GwYvM2xR

If you would please refer to the documentation, you'll see how the FlatTableProjection let's Marten control the table that it writes to (i.e. migrations):

https://martendb.io/events/projections/flat.html#flat-table-projections

And then also see this for teaching Marten how to control/manage arbitrary schema objects:

https://martendb.io/schema/extensions.html