I have a scenario in which I'm looking to register IntegrationFlow Spring beans based on the contents of a JPA database table.
For example, the table will look like:
@Entity
class IntegrationFlowConfig {
private long id;
private String local;
private String remote;
}
and I want an IntegrationFlow registered as a Spring bean for each entry found in the above table definition. When a row is added, a new bean is registered, and when a row is deleted, the corresponding bean is destroyed.
I've considered creating an EntityListener for the above entity, in which @PostPersist and @PostRemove will create/destroy IntegrationFlow beans via IntegrationFlowContext, but this solution seemed a bit clunky, and I was wondering if there was any functionality that exists that's a bit more streamlined to solve the above problem. Perhaps some sort of row mapping functionality that can map spring beans to JPA database rows, etc?
Any help would be much appreciated!
thanks,
Monk