Search code examples
spring-integration

Spring IntegrationFlow StoredProcPollingChannelAdapter


How do we pass the update query for the StoredProcPollingChannelAdapter to update the fetched rows?

@Bean
public MessageSource<Object> fromDatabase() {

    return new StoredProcPollingChannelAdapter(storedProcExecutor());
}

@Bean
public StoredProcExecutor storedProcExecutor() {

    var storedProcExecutor = new StoredProcExecutor(datasource);
    storedProcExecutor.setStoredProcedureName("proc_name");

    return storedProcExecutor;
}

Solution

  • You said it yourself - stored procedure. There is no reason to have a separate simple operation on this component since the target stored procedure can do everything for us before returning from DB.