Having event handlers in seprate springboot application

131 views
Skip to first unread message

2011a...@gmail.com

unread,
Sep 21, 2020, 8:50:09β€―AM9/21/20
to Axon Framework Users
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

Steven van Beelen

unread,
Sep 21, 2020, 10:11:52β€―AM9/21/20
to Axon Framework Users
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

--
πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡
Β 
❗ Please note that this mailing list will be discontinued on September 28 ❗
We are moving to https://discuss.axoniq.io/ and we do hope you'll join us there.
For more details please see https://groups.google.com/g/axonframework/c/V77Wq9g2HLU
Β 
πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†
---
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/8096675b-4dd9-4fba-a4d3-abae802a77d2n%40googlegroups.com.

Ashwini Kumar

unread,
Sep 21, 2020, 10:30:34β€―AM9/21/20
to axonfr...@googlegroups.com
Thanks for the reference Steven. I will post any further questions on the new group that you have mentioned

2011a...@gmail.com

unread,
Sep 22, 2020, 2:07:44β€―PM9/22/20
to Axon Framework Users
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Β 

Steven van Beelen

unread,
Sep 24, 2020, 7:23:27β€―AM9/24/20
to Axon Framework Users
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

Ashwini Kumar

unread,
Sep 24, 2020, 12:01:27β€―PM9/24/20
to axonfr...@googlegroups.com
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

You received this message because you are subscribed to a topic in the Google Groups "Axon Framework Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/axonframework/Myhr9V6C4NY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/CA%2BBh86mzkzZTdU8K%3Df9fWExn5voyx6KtuufoXA_VoViQN_S65Q%40mail.gmail.com.

Steven van Beelen

unread,
Oct 30, 2020, 11:51:17β€―AM10/30/20
to Axon Framework Users
Hey Ashwinin,

Yes, your understanding there is correct.

Cheers,
Steven

Reply all
Reply to author
Forward
0 new messages