Hi guys!
There is no documentation in the migration doc here:
https://docs.axoniq.io/reference-guide/3-migration/migration-guide
Most of the upgrades were classes moving around. That was no big deal.
The biggest change was the default move to tracking from subscribing event processing.
It made me have to create a:
@Bean(name = "tokenStore")
public TokenStore tokenStore() {
return MongoTokenStore.builder()
.mongoTemplate(axonMongoCMSTemplate())
.serializer(xStreamSerializer())
.build();
}
I could see that 21 entries were successfully being created; each entry corresponding to packages that contain event handlers. By default, tokenType is set to: [B and token is a binary value. When it gets time to deserialize, Axon doesn’t know what to do with type [B.
@Bean(name = "jacksonSerializer")
public Serializer jacksonSerializer() {
return JacksonSerializer.builder()
.objectMapper(this.objectMapper)
.converter(chainingConverter())
.build();
}
@Bean(name = "chainingConverter")
public ChainingConverter chainingConverter() {
ChainingConverter converter = new ChainingConverter();
converter.registerConverter(new StringToMongoTrackingTokenConverter(this.objectMapper));
converter.registerConverter(new MongoTrackingTokenToStringConverter(this.objectMapper));
converter.registerConverter(new StringToJsonNodeConverter(this.objectMapper));
converter.registerConverter(new JsonNodeToStringConverter());
return converter;
}
I tried to create custom converters and instead use the jacksonSerializer for the tokenStore. I changed the contentType on MongoTokenStore to use either String, JsonNode, MongoTrackingToken instead of the default byte[] but to no avail. When I set the content type to String, I could see the token in json text in my collection. But, when it tried to deserialize again, it couldn’t find a proper converter.
Right now, this is my one blocker.
I am using Spring Boot. When I first upgraded from 3 to 4 and hadn’t yet configured a tokenStore, the default in-memory one went into effect. Once my application had started, the tracking processor couldn’t find any previous position so it started processing all my events starting with the very first one. I don’t want that to happen when I deploy this to production as I’d be faced with some very confused customers and a whole lot of automatic emails I saw there was some way to control the position of the processor here:
https://docs.axoniq.io/reference-guide/1.3-infrastructure-components/event-processing#custom-tracking-token-position. But the documentation doesn’t tell me how to configure it in a Spring Boot environment. I am guessing it is something like
@Autowired
public void configure(EventProcessingConfigurer config) {
config.usingSubscribingEventProcessors(); // default all processors to subscribing mode.
}
But the documentation is not very clear on this.
I really wanted to move over to using tracking once I realized that’s the proper way to do replays. However, I can’t see a straight migration path from a production system that’s currently using subscribing event processor.
So this is where I am stuck at the moment. I will go ahead and deploy my upgrade from Axon 3 - 4, still using subscriber event processing. I would love to see a migration document that can show me a migration path from subscriber to tracking and that includes answers to my questions above. I would also love to know how to migrate from xStream to Jackson in a production system without any downtime.
Finally, on a side note, when the tracking processor started processing my old events from 2 years back, it failed to process some of the events. It seems on some older version of Axon, timestamp was referred to as timeStamp and it couldn’t find that property and promptly failed.
Thank you,
Bjorn