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

Add support for Component classes for spring cloud stream plugin (#684) #688

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

stavshamir
Copy link
Member

Until now, cloud stream plugin could auto detect Consumer/Supplier/Function bean methods:

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

But the following valid configuration was not detected:

@Component
public class MyConsumer implements Consumer<String> {
  @Override
  public void accept(String payload) {
    log.info(payload);
  }
}

This PR adds support for auto-detections of Component class in cloud stream plugin. These now lead to the creation of channels and operations automatically.

Additionally, to support this feature ChannelBindingProcessor now accepts AnnotatedElement instead of Method. Bindings could now potentially be used on classes as well, but I did not change the only existing implementation (google pubub) for now.

@stavshamir stavshamir requested review from timonback and sam0r040 April 6, 2024 12:52
Copy link

netlify bot commented Apr 6, 2024

Deploy Preview for springwolf-ui canceled.

Name Link
🔨 Latest commit 24a46e6
🔍 Latest deploy log https://app.netlify.com/sites/springwolf-ui/deploys/661147176a2d920008f71921

@stavshamir stavshamir linked an issue Apr 6, 2024 that may be closed by this pull request
@stavshamir stavshamir merged commit 86960c6 into master Apr 6, 2024
23 checks passed
@stavshamir stavshamir deleted the 684-spring-cloud-stream-consumers-not-detected branch April 7, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring Cloud Stream Consumers not detected
2 participants