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

Spring Cloud Stream Consumers not detected #684

Closed
rafaelzig opened this issue Apr 5, 2024 · 5 comments · Fixed by #688
Closed

Spring Cloud Stream Consumers not detected #684

rafaelzig opened this issue Apr 5, 2024 · 5 comments · Fixed by #688
Assignees
Labels

Comments

@rafaelzig
Copy link

rafaelzig commented Apr 5, 2024

Describe the bug
In the context of Spring Cloud Function Support, Springwolf does not automatically detect consumer beans declared with @Component annotation instead of @Bean.

Dependencies and versions used

  • springwolf-cloud-stream:1.1.0
  • springwolf-ui:1.1.0'

Code example
This works:

@Configuration
@Log4j2
public class MyConsumerConfiguration {
  @Bean
  public Consumer<String> myConsumer() {
    return log::info;
  }
}

But this does not work:

@Component
@Log4j2
public class MyConsumer implements Consumer<String> {
  @Override
  public void accept(String payload) {
    log.info(payload);
  }
}
@rafaelzig rafaelzig added the bug Something isn't working label Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

@stavshamir
Copy link
Member

Hi @rafaelzig, thanks for reporting this issue. It seems like the cloud stream plugin indeed does not scan @Component classes. I'm on it.

@stavshamir
Copy link
Member

@rafaelzig please try the snapshot version and see if this fix works.

@rafaelzig
Copy link
Author

@stavshamir Thank you for the swift response.
I can confirm that the issue is resolved with the version 1.2.0-SNAPSHOT

@stavshamir
Copy link
Member

@rafaelzig No problem! The fix will be released in 1.3.0 in the beginning of next month.
If you find the project useful, please consider starring it, it helps us spread the word 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants