Skip to content

GH-8654: Fix bean deps for messaging annotations #8657

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

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ else if (reactive != null) {
String endpointBeanName =
generateHandlerBeanName(beanName, mergedAnnotations)
.replaceFirst("\\.(handler|source)$", "");
this.beanFactory.registerDependentBean(beanName, endpointBeanName);
this.definitionRegistry.registerBeanDefinition(endpointBeanName, endpointBeanDefinition);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.mqtt.core.Mqttv3ClientManager;
Expand Down Expand Up @@ -195,8 +196,9 @@ public Mqttv5ClientManager mqttv5ClientManager() {
}

@Bean
public IntegrationFlow mqttOutFlow(Mqttv5ClientManager mqttv5ClientManager) {
return f -> f.handle(new Mqttv5PahoMessageHandler(mqttv5ClientManager));
@ServiceActivator(inputChannel = "mqttOutFlow.input")
public Mqttv5PahoMessageHandler mqttv5PahoMessageHandler(Mqttv5ClientManager mqttv5ClientManager) {
return new Mqttv5PahoMessageHandler(mqttv5ClientManager);
}

@Bean
Expand Down