[MNT-24937] Fix EventTableOutbox messages flooding the logs on bootstrap failure (#3286)

This commit is contained in:
cezary-witkowski
2025-04-01 15:04:58 +02:00
committed by GitHub
parent ebb0355692
commit 388c12ab3e
3 changed files with 11 additions and 5 deletions

View File

@@ -542,10 +542,7 @@ public class EventGenerator extends AbstractLifecycleBean implements Initializin
@Override
protected void onShutdown(ApplicationEvent applicationEvent)
{
if (eventSender != null)
{
eventSender.destroy();
}
// NOOP
}
protected class EventTransactionListener extends TransactionListenerAdapter

View File

@@ -52,7 +52,7 @@ public interface EventSender
}
/**
* It's called when the application context is closing, allowing {@link org.alfresco.repo.event2.EventGenerator} to perform cleanup operations.
* It's called when the bean instance is destroyed, allowing to perform cleanup operations.
*/
default void destroy()
{

View File

@@ -156,4 +156,13 @@ public class EventSenderFactoryBean extends AbstractFactoryBean<EventSender>
{
return event2MessageProducer;
}
@Override
protected void destroyInstance(EventSender eventSender)
{
if (eventSender != null)
{
eventSender.destroy();
}
}
}