> how is the test done? Are all commands fired using a single thread, or
> multiple?
all is single threaded, I certainly will look into asynchrounous
commands/ events later
> Do I see correctly that you included the event handlers (updating a
> mongodb) in the test as well?
Yes, the full cqrs roundtrip is tested: from issuing a command to
storing a DTO in the read-store
this is the test code:
@Test
public void loadtest() {
// Given a Recipe
// CreateRecipe createRecipe = new CreateRecipe(expectedId,
// "test-rezept", ownerId);
// cmdBus.dispatch(createRecipe);
AddIngredient addIngredient = new AddIngredient(expectedId, ownerId,
MÖHRCHEN, 30);
StringBuffer periodreport = new StringBuffer();
for (int i = 0; i < 100; i++) {
DateTime t0 = DateTime.now();
cmdBus.dispatch(addIngredient);
Period period = new Period(t0, DateTime.now());
periodreport.append(period).append("\n");
}
System.out.println(periodreport);
}
> Did you use the FileSystemEventStore? If you were using the JpaEventStore,
> I could explain the downgrade at 1100 events: events are retrieved in
> batches of 1000
No it is really the FS store. It seems to me that the read operations
are interfered, probably because the OS distributes access to the
harddisk resource between all the running processes and now the file
is big enough that the read operation is interrupted.
Here is the configuration:
<bean
class="org.axonframework.commandhandling.annotation.AnnotationCommandHandlerBeanPostProcessor">
<property name="commandBus" ref="commandBus"/>
</bean>
<bean
class="it.bz.tis.nutrition.recipe.commands.RecipeCommandHandler"/>
<bean
class="org.axonframework.eventhandling.annotation.AnnotationEventListenerBeanPostProcessor">
<property name="eventBus" ref="eventBus"/>
</bean>
<bean class="it.bz.tis.nutrition.qry.recipe.RecipeDtoMapper"/>
<axon:event-bus id="eventBus"/>
<axon:command-bus id="commandBus"/>
<axon:filesystem-event-store id="eventStore" base-dir="./data"/>
<bean id="recipeRepository"
class="org.axonframework.eventsourcing.GenericEventSourcingRepository">
<constructor-arg
value="it.bz.tis.nutrition.recipe.domain.Recipe"/>
<property name="eventBus" ref="eventBus"/>
<property name="eventStore" ref="eventStore"/>
</bean>
Anyway, any suggestions for performance or other improvements are
welcome.
Cheers, ro
>
> Anyway, interesting data to see. Thanks for sharing!
>
> Cheers,
>
> Allard
>