Skip to content

Exception handling with SimpleApplicationEventMulticaster [SPR-11551] #16176

@spring-projects-issues

Description

@spring-projects-issues

cemo koc opened SPR-11551 and commented

org.springframework.context.event.SimpleApplicationEventMulticaster is responsible to multicast event to appropriate listeners.

An exception which is not handled by user is causing to stop other listeners. This behaviour can be annoying if you have 3rd party event listeners which are not handling exceptions. I think that an event listener should not prevent other listeners in case an error. For example, after a login event we are doing some sort of things one by one. Updating some tables, some numbers, calling a restful web service etc... An exception which is not caught is causing to stop other listeners.

I am considering two alternative approach:

Try-Catch and Log Only

In this approach all exceptions must be caught and logged.

Try-Catch and Throw Again at the end

The second approach I am considering is that an exception must be caught and after all can be thrown again.

What do you think?


Affects: 3.2.8

Referenced from: commits 49916bb

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions