2017-06-21 83 views
0

我計劃使用控制總線功能在Spring的集成管理端點的入站即入站文件適配器,消息驅動適配器等獲取列表

爲了控制公車去上班,適配器ID是強制性的。我不想硬編碼的身份證。有沒有辦法列出所有入站適配器並獲取ID?

+0

如何在Spring集成DSL使用'org.springframework.integration.annotation.Role'。 我嘗試使用上IntegrationFlow豆@Role註釋,但是當我查詢了'roleController.getRoles()'和返回空列表。 @角色與@ServiceActiviator和其他Spring集成Java配置一起使用,但是如何將它與Spring Integration DSL配合使用? – Ganesh

回答

0

入站通道適配器由SourcePollingChannelAdapter表示。所有消息驅動的通道適配器都是MessageProducerSupportMessageGatewaySupport

您需要申請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