 => {       config = Some(event.config)       eventProducer.foreach(_.close())       eventProducer = Some(new KafkaEventProducer(event.env, event.config, topicFunction))       if (event.config.sendEvents) {         eventProducer.get.publish(event.event).andThen {           case Failure(e) => logger.error("Error while pushing event to kafka", e)         }       }     }     case event: KafkaWrapperEvent 