Event Sequencing and Segment Information

Hello,

I’m reading this article about Split & Merge.
According to the article:

  • Each event has a sequence and a Sequencing Policy Value.
  • Each segment has an identifier and a mask.

In an Axon Server application, how can I log this information?

Hi @Aymen_Kanzari, let me shine some light on your questions.

Sequence / Sequencing Policy

An event’s sequence can be regarded as the globalIndex value. It’s this global index in Axon Server that dictates the overall ordering of the events.

The SequencingPolicy, and the value generated by it, are Axon Framework details. The SequencingPolicy is a functional interface that ingests an EventMessage and providers a value. It’s this value that is used to decide to which segment an event belongs.

This information is, however, not something Axon Server is aware of. As such, it is not something you can log from there.
If you want Axon Framework to log this information, the simplest solution would be to configure a custom SequencingPolicy that logs the outgoing value by wrappen an actual implementation.

By the way, the SequencingPolicy defaults to the SequentialPerAggregatePolicy. This policy outputs the aggregate identifier, which is then used to conclusively decide to which segment an event belongs.

The aggregate identifier would be something you could log, of course. However, since you may have configured another SequencingPolicy, this isn’t a fact.

Segement ID and Mask

The mask is, sadly, not something you can easily get logged by Axon Framework at all. This would require you to adjust the streaming event processor you’re using. All that AF does log concerning the segment, is the segment identifier. The clearest implementation concerning event processor logging, is the PooledStreamingEventProcessor, by the way.

So, again, this isn’t information that Axon Server can log for you. Segments are consumer details, thus details that Axon Server is not aware of.


That said, I am curious why you are asking how to get hold of these details. What will you do with that info if I may ask?