Skip to content

Micronaut Support#4170

Open
KDanisme wants to merge 1 commit into
AxonIQ:mainfrom
KDanisme:main
Open

Micronaut Support#4170
KDanisme wants to merge 1 commit into
AxonIQ:mainfrom
KDanisme:main

Conversation

@KDanisme

@KDanisme KDanisme commented Feb 9, 2026

Copy link
Copy Markdown

Initial implementation of micronaut-extension

This introduces implementations for:

  • LifecycleRegistry
  • ComponentRegistry
  • AxonConfiguation
  • AxonApplication

The only thing currently missing in this implementation is decoration of non-manually registered beans.
Implementhing this is a bit problematic and really goes againts Micronauts Reflection-less appraoch to stuff.
Therefore I left it as unimplemented for now.

@CLAassistant

CLAassistant commented Feb 9, 2026

Copy link
Copy Markdown

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

smcvb commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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

smcvb commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

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,

@KDanisme KDanisme force-pushed the main branch 2 times, most recently from 21a13b5 to 70d5db8 Compare February 22, 2026 20:11
@KDanisme KDanisme force-pushed the main branch 2 times, most recently from 01b92c5 to 2b1cd74 Compare June 8, 2026 19:38
@KDanisme KDanisme force-pushed the main branch 3 times, most recently from d6fbb88 to 92a2728 Compare June 14, 2026 09:08
Initial implementation of micronaut-extension

This introduces implementations for:
- LifecycleRegistry
- ComponentRegistry
- AxonConfiguation
- AxonApplication

The only thing currently missing in this implementation is decoration of non-manually registered beans.
Implementhing this is a bit problematic and really goes againts Micronauts Reflection-less appraoch to stuff.
Therefore I left it as unimplemented for now.
@KDanisme KDanisme marked this pull request as ready for review June 14, 2026 14:02
@KDanisme KDanisme requested a review from a team as a code owner June 14, 2026 14:02
@KDanisme KDanisme requested review from hatzlj, hjohn and laura-devriendt-lemon and removed request for a team June 14, 2026 14:02
@KDanisme

KDanisme commented Jun 14, 2026

Copy link
Copy Markdown
Author

After a long period of:

  • War
  • Priority shifts
  • Waiting for Micronaut-5 to release
  • War

This feature is finally ready I think.

This was the harder part of integration probably.

There are still some unanswered questions regarding the heavy usage of relfection.

But the main work done here is to make all the tests pass and work, so refactoring will be a breeze.

@KDanisme

Copy link
Copy Markdown
Author

Ping @smcvb,
Not sure if you saw that this is ready, let me know if I can help the review process in any way.
Ill be happy to how on call as you've previously offered.

@smcvb

smcvb commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Ping @smcvb, Not sure if you saw that this is ready, let me know if I can help the review process in any way. Ill be happy to how on call as you've previously offered.

Definitely spotted it, @KDanisme! I just can't prioritize this right away with the other tasks. We are nearing a minor release and this PR is not part of that, sadly enough. Once we have the time, I can assure you we'll review your PR.

@smcvb smcvb added this to the Release 5.3.0 milestone Jul 1, 2026
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