How to setup SpringPrototypeAggregateFactory with sping?

Hi,

I tried to set up SpringPrototypeAggregateFactory in my spring config but I did not find where and how to do so. I assume it has to be done in axon:event-sourcing-repository - but there’s no config option for this. I googled a lot but did not find a solution.

Kind regards,
Michael.

If I could set it up, my spring context would contain a prototype bean. So would I still require the “axon:aggregate-command-handler” setup?

If I recall correctly (can’t check right now), there is an attribute that allows you to specify an AggregateFactory. That should refer to a bean of type SpringPrototype…Factory. That factory then refers to another bean, which must have scope prototype.

Cheers,

Allard

Yes, the command-handler definition is completely unrelated to how the aggregates are constructed. It just registers command handlers defined on an aggregate type with the command bus.

Cheers,

Allard