code: public void publishEvent(@Observes Object event) throws IOException {
          Class<?> eventType = event.getClass();
          LOGGER.debug("Receiving event of type {}", eventType.getSimpleName());
          if (! publisherConfigurations.containsKey(eventType)) {
              LOGGER.debug("No publisher configured for event of type {}", eventType.getSimpleName());
              return;
          }
          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;
          }
      }
docs: Observes CDI events for remote events and publishes those events if their event type
  was added before.
  
  @param event The event to publish
  @throws IOException if the event failed to be published