Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having a field of type EventDeliveryExceptionHandler doesn't support scenario where class is proxied #18

Open
cer opened this issue Oct 27, 2019 · 1 comment

Comments

@cer
Copy link
Collaborator

cer commented Oct 27, 2019

f.get() returns null

@jltnf54
Copy link

jltnf54 commented Nov 12, 2019

would something like this work:

    final Object singletonTarget = AopProxyUtils.getSingletonTarget(eventHandlerBean);
    final Object targetBean = null != singletonTarget ? singletonTarget : eventHandlerBean;

    final List<EventDeliveryExceptionHandler> exceptionHandlers =
        FieldUtils.getAllFieldsList(targetBean.getClass())
            .stream()
            .filter(this::isExceptionHandlerField)

Also would it be possible to pass information about the event in the handler:
EventDeliveryExceptionHandler ->
handle(EventDeliveryExceptionHandlerState state, Throwable t, Runnable retry, Consumer fail, Runnable ignore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants