Reputation: 1769
I'm currently trying to read all events from an AxonDB eventstore and export them to a CSV file. The chosen approach is to create an EventHandler in a Spring Boot application which is attached to the AxonDB server. Using a TrackingEventProcessor with the InMemoryTokenStore (default) I'd expect all the events to be read from the event store each time I boot this small application.
Unfortunately I'm not receiving the events from the AxonDB client in my TrackingEventProcessor, which has been boggling me for a couple of hours now. I went into the belly of the beast and saw the following behaviour, which I'd like to discuss:
2018-08-16 13:56:49.337 DEBUG 27781 --- [ault-executor-0] i.a.axondb.client.axon.AxonDBEventStore : Received event with token: 17742
etc2018-08-16 14:18:50.190 INFO 30006 --- [t-projection]-0] o.a.e.TrackingEventProcessor : Fetched token: null for segment: Segment[0/0]
if (eventStream.hasNextAvailable(1, SECONDS))
I've been biting the dust for a while now, and think I've come to a dead end. I'm receiving no error messages or exceptions. Reading the events seems to work, confirmed by to the AxonDBEventStore logging. But after this, the EventBuffer stays empty, so my processor never even gets to check whether it is supposed to handle the events that it is presented with. The name of my processor can therefore not be the problem here, I suppose. I tried several processor names (which match the data in the events) without any luck. Deserialization does seem to work, since I found a deserialized event somewhere during debugging yesterday (can't remember where though...). It looked as I'd expect.
Does anyone have an idea what might be the problem here?
Upvotes: 0
Views: 576
Reputation: 1769
Unfortunately I was never able to finish this piece of software since another way was found to solve the problem. I suspect that the event were not appearing in the TrackingEventProcessor since I did not have the POJO representation of the events in my project, like Milan suggested.
My initial intention was to create a generic tool to re-write the GenericEventMessage to CSV through a Spring application, not write a specific tool for the project that I was working on. Probably this is not possible and the TrackingEventProcessor needs the POJO on your classpath to generate the GenericEventMessage. This had not occurred to me earlier.
Upvotes: 0
Reputation: 61
You mentioned that you have two different applications. Do you have a common module between those applications which shares the core API (commands, events, and queries)? If by any chance that is not the case, does the fully qualified name of your events matches (one in the publishing application and one the consuming application)? If the fully qualified name of events does not match, tracking event processor will not be able to pick it up.
Let me know if this helps you!
Cheers, Milan.
Upvotes: 1
Reputation: 361
Could you try to upgrade the AxonDB client to version 1.3.1, as the 1.3 version had an issue when there were no upcasters defined.
Please let me know if this helps.
Regards,
Marc Gathier
Upvotes: 1