|
29 | 29 | import org.springframework.context.ApplicationListener;
|
30 | 30 | import org.springframework.context.PayloadApplicationEvent;
|
31 | 31 | import org.springframework.context.event.AbstractApplicationEventMulticaster;
|
32 |
| -import org.springframework.context.event.ApplicationEventMulticaster; |
33 | 32 | import org.springframework.context.event.ApplicationListenerMethodAdapter;
|
34 | 33 | import org.springframework.core.ResolvableType;
|
35 | 34 | import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
|
41 | 40 | import org.springframework.modulith.events.core.PublicationTargetIdentifier;
|
42 | 41 | import org.springframework.transaction.event.TransactionPhase;
|
43 | 42 | import org.springframework.transaction.event.TransactionalApplicationListener;
|
44 |
| -import org.springframework.transaction.event.TransactionalEventListener; |
45 | 43 | import org.springframework.util.Assert;
|
46 | 44 | import org.springframework.util.ReflectionUtils;
|
47 | 45 |
|
48 | 46 | /**
|
49 |
| - * An {@link ApplicationEventMulticaster} to register {@link EventPublication}s in an {@link EventPublicationRegistry} |
50 |
| - * so that potentially failing transactional event listeners can get re-invoked upon application restart or via a |
51 |
| - * schedule. |
| 47 | + * An {@link org.springframework.context.event.ApplicationEventMulticaster} to register {@link EventPublication}s in an |
| 48 | + * {@link EventPublicationRegistry} so that potentially failing transactional event listeners can get re-invoked upon |
| 49 | + * application restart or via a schedule. |
52 | 50 | * <p>
|
53 | 51 | * Republication is handled in {@link #afterSingletonsInstantiated()} inspecting the {@link EventPublicationRegistry}
|
54 | 52 | * for incomplete publications and
|
@@ -174,7 +172,13 @@ private void invokeTargetListener(EventPublication publication) {
|
174 | 172 | private ApplicationListener<ApplicationEvent> executeListenerWithCompletion(EventPublication publication,
|
175 | 173 | TransactionalApplicationListener<ApplicationEvent> listener) {
|
176 | 174 |
|
177 |
| - listener.processEvent(publication.getApplicationEvent()); |
| 175 | + try { |
| 176 | + listener.processEvent(publication.getApplicationEvent()); |
| 177 | + } catch (Exception o_O) { |
| 178 | + if (LOGGER.isErrorEnabled()) { |
| 179 | + LOGGER.error("Error republishing event publication " + publication, o_O); |
| 180 | + } |
| 181 | + } |
178 | 182 |
|
179 | 183 | return listener;
|
180 | 184 | }
|
@@ -212,7 +216,7 @@ private static boolean matches(ApplicationEvent event, Object payload, Applicati
|
212 | 216 | * implement {@link TransactionalApplicationListener}.
|
213 | 217 | *
|
214 | 218 | * @author Oliver Drotbohm
|
215 |
| - * @see TransactionalEventListener |
| 219 | + * @see org.springframework.transaction.event.TransactionalEventListener |
216 | 220 | * @see TransactionalApplicationListener
|
217 | 221 | */
|
218 | 222 | static class TransactionalEventListeners {
|
|
0 commit comments