onApplicationEvent() is never invoked on DelayHandler
<p>I'm using Spring Boot and Spring Integration Java DSL in my @Configuration class. One of the flows is using DelayHandler with MessageStore, by means of .delay(String groupId, String expression, Consumer endpointConfigurer):</p>

<pre><code>@Bean
public IntegrationFlow errorFlow() {
    return IntegrationFlows.from(errorChannel())
            ...
            .delay(...)
            ...
            .get();
}
</code></pre>

<p>I was hoping to utilize the reschedulePersistedMessages() functionality of DelayHandler, but I found out the onApplicationEvent(ContextRefreshedEvent event) which invokes it is actually never invoked (?)</p>

<p>I'm not sure, but I suspect this is due to the fact DelayHandler is not registered as a Bean, so registerListeners() in AbstractApplicationContext is not able to automatically register DelayHandler (and registration of non-bean listeners via ApplicationEventMulticaster.addApplicationListener(ApplicationListener listener) is not done for DelayHandler.</p>

<p>Currently I'm using a rather ugly workaround of registering my own listener Bean into which I inject the integration flow Bean, and then invoking the onApplicationEvent() manually after locating the DelayHandler:</p>

<pre><code>@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
    Set&lt;Object&gt; integrationComponents = errorFlow.getIntegrationComponents();
    for (Object component : integrationComponents) {
        if (component instanceof DelayerEndpointSpec) {
            Tuple2&lt;ConsumerEndpointFactoryBean, DelayHandler&gt; tuple2 = ((DelayerEndpointSpec) component).get();
            tuple2.getT2().onApplicationEvent(event);
            return;
        }
    }
}
</code></pre>