获取列表
问题描述:
我计划使用控制总线功能在Spring的集成管理端点的入站即入站文件适配器,消息驱动适配器等获取列表
为了控制公车去上班,适配器ID是强制性的。我不想硬编码的身份证。有没有办法列出所有入站适配器并获取ID?
答
入站通道适配器由SourcePollingChannelAdapter
表示。所有消息驱动的通道适配器都是MessageProducerSupport
或MessageGatewaySupport
。
您需要申请BeanFactory.getBeansForType()
所有这些提到的类。
如果您打算仅处理它们的start()/stop()
函数,同时考虑使用它们的通用接口Lifecycle
。
还有RoleController
管理生命周期的群体:http://docs.spring.io/spring-integration/docs/4.3.10.RELEASE/reference/html/messaging-endpoints-chapter.html#endpoint-roles
+0
谢谢Artem。我会试一试。 – Ganesh
如何在Spring集成DSL使用'org.springframework.integration.annotation.Role'。 我尝试使用上IntegrationFlow豆@Role注释,但是当我查询了'roleController.getRoles()'和返回空列表。 @角色与@ServiceActiviator和其他Spring集成Java配置一起使用,但是如何将它与Spring Integration DSL配合使用? – Ganesh