2017-04-18 80 views
0

我已經創造了一些IntegrationFlow在Spring的集成是這樣的:以編程方式啓動和停止Spring集成中的某些IntegrationFlows?

IntegrationFlows.from(..).id("test").autoStartup(false). .. 

我如何查找在Spring集成這種集成流程並開始了嗎?我正在尋找類似於org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistry的東西,可用於啓動和停止RabbitListener實例。

回答

1

使用流動

@Bean 
public IntegrationFlow flow() {...} 


... 


@Autowired 
public IntegrationFlow flow; 

... 

flow.stop(); 
(在 ApplicationContextgetBean("flow")

的bean的名字。