获取spring集成入站适配器的列表

时间:2017-06-21 03:36:01

标签: spring spring-integration

我计划在spring集成中使用控制总线功能来管理入站端点,即入站文件适配器,消息驱动适配器等。

为了使控制总线正常工作,必须使用适配器ID。我不想硬编码id。有没有办法列出所有入站适配器并获得Id?

1 个答案:

答案 0 :(得分:0)

入站通道适配器由SourcePollingChannelAdapter表示。所有消息驱动的渠道适配器均为MessageProducerSupportMessageGatewaySupport

您需要为所有提到的课程申请BeanFactory.getBeansForType()

如果您只打算处理Lifecycle功能,请考虑使用常用的start()/stop()界面。

还有RoleController来管理生命周期组:http://docs.spring.io/spring-integration/docs/4.3.10.RELEASE/reference/html/messaging-endpoints-chapter.html#endpoint-roles