相关文章推荐
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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:

  • First off, I'm using all the same versions that the original application (which fills the event store) also uses:
  • axonDB 1.3
  • axonDB client 1.3
  • Axon framework 3.2.1
  • The application connects to AxonDB successfully through gRPC
  • The AxonDBEventStore reads a bunch of events
  • 2018-08-16 13:56:49.337 DEBUG 27781 --- [ault-executor-0] i.a.axondb.client.axon.AxonDBEventStore : Received event with token: 17742 etc
  • My TrackingEventProcessor is started with Segment[0/0], which seems correct to me since I use the InMemoryTokenStore
  • 2018-08-16 14:18:50.190 INFO 30006 --- [t-projection]-0] o.a.e.TrackingEventProcessor : Fetched token: null for segment: Segment[0/0]
  • The TrackingEventProcessor starts running and tries to pass the following statement (from source code line 248 in version 3.2.1):
  • if (eventStream.hasNextAvailable(1, SECONDS))
  • above check always returns 'false', because the implementation of the eventStream (EventBuffer from the AxonDB client) always comes back without results.
  • 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?

    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

    Hi Marc, thanks for your answer. I tried this just now. Unfortunately it does not change the behaviour of the application. I'm still getting the same results. Ostecke Aug 17, 2018 at 7:10

    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.

    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.

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .

     
    推荐文章