Having event handlers in seprate springboot application

Hi,

I am using axon 4.2 with kafka as my event bus(using axon kafka extension). I am trying to create an event within a springboot application say A and publishing that domain event on the kafka topic using aggregateLifecycle.apply, as I am using kafka as my event bus, Now I am trying to have the event handler for the same in the springboot application B.
Is the above scenario possible.

Thanks

Hi Ashwini,

Just to reiterate this again, but please use https://discuss.axoniq.io/ for any new issues you might have instead of the mailing list, as the mailing list will be closed.

When it comes to your question: yes, that’s possible.
Please see the Kafka Extensions example here for some thoughts on how to achieve this.

Cheers,
Steven

Thanks for the reference Steven. I will post any further questions on the new group that you have mentioned

Hi Steven,

My events are generated in a springboot app which is running on a node say N1 but my event handlers are in another springboot app which is running on a different node say N2 and the owner column in my tokenentry has node N1 as the owner and the event handlers are not getting triggered probably because the owner is not N2. Is this the expeted behaviour that the segment should always be owned by the same node i.e. in this case N2 for my event handlers to be triggered.
I am using tracking event processor

Hi Ashwini,

For a Tracking Event Processor (TEP) to be able to do any work, it requires the claim on a Tracking Token.
Thus, a claim on the tokens stored in the token_entry table.
Through this claim, the TEP can coordinate work between distinct instances of the TEP or different threads present on the same TEP.

So what you are noticing, is the fact you only have a single tracking token, thus only segmented the event stream into a single set.
This means that two distinct nodes, both running the same TEP with a single thread, will still run single threaded.

If you want to multi-thread this process, you will have to segment the work into distinct portions by segmenting the tracking token into several pieces.

I’d recommend having a look at the reference guide on the matter, and start reading from here, to get a feel how to achieve this parallelization.

Cheers,
Steven

Thanks Steven for your response.
We can still have multiple nodes and just one tracking event processor and it will work just fine.
Is my understanding correct?

Thanks,
Ashwini