Skip to content

Micronaut Support#4170

Draft
KDanisme wants to merge 2 commits intoAxonIQ:mainfrom
KDanisme:main
Draft

Micronaut Support#4170
KDanisme wants to merge 2 commits intoAxonIQ:mainfrom
KDanisme:main

Conversation

@KDanisme
Copy link
Copy Markdown

@KDanisme KDanisme commented Feb 9, 2026

This is a draft for a micronaut support.

The code is NOT ready yet.
Im creating this PR for visibility and possible general feedback

I should be able to finish this up (make tests pass) in about a week.

There are some qustions of code/interface deduplications which I will raise in a few days.

Really looking forward for this!

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

@smcvb smcvb added the Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. label Feb 11, 2026
@smcvb
Copy link
Copy Markdown
Contributor

smcvb commented Feb 11, 2026

First and foremost, I want to commend the effort to providing a Micronaut integration for Axon Framework 5, @KDanisme! This is not just a simple contribution, but a rather massive feature.

With that said, we can definitely start a conversation on how to approach the integration between Axon Framework 5 and Micronaut.

I do want to point out that your PR is extremely large. The Framework team has quite a lot of tasks on their plate with frequent context switching.
A 10k line PR is simply not a one hour review; this will definitely take a day, if not more, to fully comprehend.
Hence, I would like to ask you to break down the PR into manageable chunks of about 1k line changes, ideally.

I do have a rough breakdown suggestion for this which may help:

  1. First and foremost, I think I'd expect a ComponentRegistry implementation for Micronaut. This is Axon Framework's configuration core and arguably the initiation point of the Spring integration too.
  2. Looking at lifecycle handler management would come second, through integration with the LifecycleRegistry. Axon's components need to partake cleanly in start up and shutdown of application; this interface ensures start-up and shutdown handlers are registered correctly. You could pull learning from the DefaultAxonApplication and SpringLifecycleRegistry perhaps to see how this is set up.
  3. If I recall correctly Micronaut also supports a notation of annotations. I think annotation support / integration would come in the third place.
  4. Full auto configuration would in my opinion come last. Furthermore, this step can be broken down in the separate PRs quite cleanly, as the autoconfiguration is broken down in separate classes any how.

@smcvb smcvb added the Type: Feature Use to signal an issue is completely new to the project. label Feb 11, 2026
@KDanisme
Copy link
Copy Markdown
Author

Hi @smcvb
Agree with everything said.
I already roughly implemented most of the stuff,
including the annotation processors (which works mostly reflection thanks to microanuts ksp plugin).

The main issue/question I had was the autoconfiguration matter.

I don't really have experience in spring, but from the way the packages are built I understand you have a package for the implementation(extension) and a package for the configuration(autoconfiguration).

But,
Micronaut doesn't really do auto-configuration.
Implementation and configuration sit in the same place, this is also the case for micronauts own libraries as well as user code.
Just the presence of the class in the classpath registers it in the bean context.

This can be mimicked using @Factory but this is used to create/register external classes which you don't define.

So I could go on to making an autoconfiguration module, but its quite an anti-pattern.

Are there any implications for creating a single package which does both?
Is there a use-case for using the extension without the auto-configuration?

There are alternatives such as package-info level property that can be set to disable all autoconfiguration, that is also common practive.
axon.micronaut.enabled=true could be enough in that case.

@smcvb
Copy link
Copy Markdown
Contributor

smcvb commented Feb 12, 2026

Are there any implications for creating a single package which does both? Is there a use-case for using the extension without the auto-configuration?

If Micronaut views autoconfiguration as an anti pattern, then the answer is easy: we do not have a Micronaut autoconfiguration package.
To be frank with you, I have not looked at Micronaut for ages, nor have I done an actual project with it.
All I know as maintainer of Axon Framework: I think an integration would be awesome and should exist.

That said, I thus lack a lot of internals on how Micronaut does XYZ. Could you, perhaps, set up a call with me so we can go through the typical approach?
If you are up for that, of course! If you are, feel free to reach out on my Linkedin,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants