Invalid Token Type

Hi folks,

I’m playing around with using different distribution technologies for the event bus. In particular, we use AxonServer and Kafka Connector.
Probably I’m too naive, because I tried to use both of them in the same time (two different deployments, different configuration, same processing group of the projection-building event handler).

As a result I got “Invalid Token Type” thrown by the tracking processor.

2019-08-20 13:53:43.950  INFO 1 --- [ongo.service]-0] o.a.e.TrackingEventProcessor             : Fetched token: IndexTrackingToken{globalIndex=117815} for segment: Segment[0/0]
2019-08-20 13:53:44.016  WARN 1 --- [ongo.service]-0] o.a.e.TrackingEventProcessor             : Error occurred. Starting retry mode.

java.lang.IllegalArgumentException: Invalid token type
    at org.axonframework.common.Assert.isTrue(Assert.java:56) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.extensions.kafka.eventhandling.consumer.KafkaMessageSource.openStream(KafkaMessageSource.java:47) ~[axon-kafka-4.0-RC2.jar!/:4.0-RC2]
    at org.axonframework.eventhandling.TrackingEventProcessor.doOpenStream(TrackingEventProcessor.java:294) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor.lambda$ensureEventStreamOpened$10(TrackingEventProcessor.java:284) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.common.transaction.TransactionManager.fetchInTransaction(TransactionManager.java:70) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor.ensureEventStreamOpened(TrackingEventProcessor.java:283) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor.processingLoop(TrackingEventProcessor.java:180) ~[axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor$TrackingSegmentWorker.run(TrackingEventProcessor.java:661) [axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor$WorkerLauncher.run(TrackingEventProcessor.java:771) [axon-messaging-4.0.3.jar!/:4.0.3]
    at org.axonframework.eventhandling.TrackingEventProcessor$CountingRunnable.run(TrackingEventProcessor.java:588) [axon-messaging-4.0.3.jar!/:4.0.3]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]

2019-08-20 13:53:44.016  WARN 1 --- [ongo.service]-0] o.a.e.TrackingEventProcessor             : Releasing claim on token and preparing for retry in 1s

Does it mean that I can’t use two different event distribution technologies but the SAME event handler / processing group running tracking mode, because of the clash of the tracking token?

Is there any workaround on this, apart of changing the Processing Group of the event handlers?

Kind regards,

Simon

Hi Simon,

Due to Axon Server’s nature, it is incapable of creating gaps in the Event Stream at all times.
As such, it uses the GlobalSequenceTrackingToken, as apposed to the GapAwareTrackingToken which we use for the JDBC, JPA and Kafka message sources.

What’s unclear to me given your description, is whether you are using the new MultiStreamableMessageSource (as described here) to ingest two distinct streams for the same Tracking Event Processor.
Is this the case?
If you are however using the single streamable message source for a given Tracking Event Processor, then I can assure you that we currently do not have functionality in place to let you automatically switch between a global and a gap-aware Tracking Token.
Let us know if this is something you are looking for.

Cheers,
Steven