class KafkaProducerRepository {

    Optional<Pair<KafkaProducer<String, String>, Pattern>> findMatchingKafkaProducer(String topic){
        for (Map.Entry<Pattern, KafkaProducer<String, String>> entry : kafkaProducers.entrySet()) {
            Matcher matcher = entry.getKey().matcher(topic);
            if(matcher.matches()){
                log.info("Found matching KafkaProducer with pattern '{}' for topic '{}' found", entry.getKey().pattern(), topic);
                return Optional.of(Pair.of(entry.getValue(), entry.getKey()));
            }
        }
        log.info("No matching KafkaProducer for topic '{}' found", topic);
        return Optional.empty();
    }

    public  KafkaProducerRepository(Vertx vertx);

}