PublisherConfiguration publisherConfiguration = publisherConfigurations.get(eventType);
MessagePublisher publisher = providePublisher(publisherConfiguration.reliability, eventType);
Message message = buildMessage(publisherConfiguration, event);
try {
LOGGER.info("Publishing event of type {}", eventType.getSimpleName());
publisher.publish(message, publisherConfiguration.deliveryOptions);
LOGGER.info("Successfully published event of type {}", eventType.getSimpleName());
} catch (IOException e) {
LOGGER.error("Failed to publish event {}", eventType.getSimpleName(), e);
throw e;
}