Is there an elegant way to define a single @MessageEndpoint
bean with multiple @ServiceActivator
methods (or something like that), where the methods' argument types are implicitly used as a payload-type-filter?
The idea is to have a single service endpoint which can handle different payload types slightly different without much effort by dispatching on the argument type, which alleviates the implementation of additional service methods down the line.
I'm aware of Google Guava's EventBus
, which dispatches event objects to any registered @Subscribe
method with a matching argument type. I'm currently using this approach, but I was wondering if this was also (kinda) possible with Spring Integration.