@DeadlineHandler matching

Hi,

we noticed that when we declare a deadline handler in a saga that doesn’t have a payload but does need a resolvable parameter (in our case a command gateway), that it is not invoked when the deadline expires. (It is in the unit test though, so we found out rather late.) I read in the documentation that matching is done by checking for the deadline name/payload type combination, so it seems like the command gateway is mistaken for the desired payload.

We currently work around this using a dummy payload, but is there a supported way of declaring such a deadline handler?

Thanks,
Levi

Hi Levi,

beans are indeed matched last, and the payload as first parameter is given preference over possible bean injections.
To work around this issue, you can assign a first parameter of type Message. It’s the fastest and easiest one for Axon to resolve.

Hope this helps.
Cheers,

Thanks Allard,

I remember joking we should try Void, but we’ll change it into Message.

Maybe it would be a nice addition to the deadlines page in the documentation?

Regards,
Levi