AxonFramework/AxonFramework — pull request #74 by andyduncan192 (2012-10-19 09:27:29+00:00)
Title: Cursors timing out visiting events in sharded collection

Hi,

I was having NullPointerExceptions when DocumentPerEventStorageStrategy was creating EventEntries after I sharded my domainevent collection. I tracked this down to cursors expiring in mongodb since my shard key is time-dependent and it was taking more than 10 minutes to get to the events in one of the shards.

In this change I've added the NOTIMEOUT option to the cursor used to visit the events and the problem has gone away. I haven't added any tests for this since I didn't want to introduce any heavy mocking into the tests. The Mongo driver is unreasonably hard to mock :)

Thanks,

Andy