Hello,
is it possible to register interceptor for specified types only?
class SystemObjectTypeInterceptor<T extends CommandMessage<CreateObjectTypeCommand>> implements MessageDispatchInterceptor<T> {
@Override
public BiFunction<Integer, T, T> handle(List<T> messages) {
return (index, message) -> {
...
};
}
}
I mean if I create interceptor like above I'd like to intercept only messages of type CreateObjectTypeCommand not for all messages. Currently all messages types pass-through this interceptor. I know that I can check the type of incoming message with my message type but shouldn't this be handled by framework? Or am I creating interceptors incorrectly?
Thanks
Lukas