@SuppressWarnings({"unchecked"})
@Override
public void handleMessage(Message<?> message) {
Class<?> eventType = message.getPayload().getClass();
if (filter.accept(eventType)) {
eventBus.publish(new GenericEventMessage(message.getPayload(), message.getHeaders()));
} else {
throw new MessageRejectedException(message, String.format(
"The event of type [%s] was blocked by the filter.",
eventType.getSimpleName()));
}