Axon/Spring/Java on Rasperry PI IoT Devices

Hello there :slightly_smiling_face:

I’m considering using the Axon Framework and Spring in our IoT projects based on Raspberry Pi devices. However, I’m a bit concerned about potential resource consumption.
So I was wondering: what has your experience been like with these technologies in similar projects?

Although I can’t say I’ve ever tried this, there are a couple of things that pop to mind.

Firstly, you’d likely want start-up to be fast for this instances. So, I’d use the Spring AoT Extension for sure. Should align quite nicely that you want to use Spring anyhow.

Secondly, you’d want to be careful with threading throughout. So, think about the thread pool used by the CommandBus, the QueryBus, and most of all, your EventProcessors. By default, every Event Handling Component (a class with @EventHandler annotated methods) with a unique package will become its own EventProcessor. Same applies for a saga: every unique saga is a new EventProcessor with its own thread pool.

Adjusted the threads for command- and query messaging is relatively straightforward (simply settings). For the Event Processor side of things, I’d recommend you use the PooledStreamingEventProcessor (PSEP) throughout and define one/several ScheduledExecutorServices (with a predefined pool size) and set the same executor(s) for all PSEPs. What thread size you’d use for this highly depends on the hardware, of course.

Both pointers are based on previous iterations of people using minimal hardware, by the way. However, I have not been the one to do these exercises. So, I can’t speak out of personal experience, just from the support end.

Nonetheless, I hope this helps!