Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing @Singleton #633

Merged
merged 3 commits into from
Aug 16, 2023
Merged

Conversation

agustin-tecso
Copy link
Contributor

The class needs to be annotated with @singleton so that it can be injected

@sdelamo
Copy link
Contributor

sdelamo commented Aug 4, 2023

Thanks @agustin-tecso

@guillermocalvo please merge master into the branch and add a test. At least verify that context contains the bean. We should have a test which detects this.

agustin-tecso and others added 3 commits August 4, 2023 17:27
The class needs to be annotated with @singleton so that it can be injected
Reason: io.micronaut.context.exceptions.NoSuchBeanException:
No bean of type [io.micronaut.configuration.kafka.docs.producer.fallback.MessageClientFallback] exists.
The bean [MessageClientFallback] is disabled because it is within the package [io.micronaut.configuration.kafka] which is disabled due to bean requirements:
  * Property [kafka.enabled] with value [false] should not equal: false
@guillermocalvo
Copy link
Contributor

I just added a test to check that the fallback bean exists in the context, and that it behaves as expected.

Ironically, I had to move the fallback bean away from the java package io.micronaut.configuration.kafka, because everything inside it gets disabled when kafka.enabled=false, defeating the very purpose of the fallback bean.

@sdelamo sdelamo merged commit 1e5387c into micronaut-projects:master Aug 16, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants