spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Support registrating listener with multiple interface implementation

Open uyw4687 opened this issue 7 months ago • 1 comments

Please do a quick search on Github issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description A clear and concise description of what the bug is about. When one class implements multiple listener interfaces at once, it does not get registered without dedicated annotations.

Environment Please provide as many details as possible: Spring Batch version, Java version, which database you use if any, etc Applicable for all versions

Steps to reproduce Steps to reproduce the issue. Implement one class implementing ItemReadListener, ItemProcessListener, ItemWriteListener at once. Then, Spring Batch tries to register with SimpleStepBuilder#listener(Object listener). However, without explicit annotations like @BeforeRead, @OnProcessError, etc., it fails to register it.

Expected behavior A clear and concise description of what you expected to happen. Register the listener if it's implementing one of the interfaces.

Minimal Complete Reproducible example Please provide a failing test or a minimal complete verifiable example that reproduces the issue. Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.

uyw4687 avatar Jul 14 '24 16:07 uyw4687