summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--event-client-kafka/src/main/java/org/onap/aai/event/client/KafkaEventPublisher.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/event-client-kafka/src/main/java/org/onap/aai/event/client/KafkaEventPublisher.java b/event-client-kafka/src/main/java/org/onap/aai/event/client/KafkaEventPublisher.java
index 2b98e27..098f1f8 100644
--- a/event-client-kafka/src/main/java/org/onap/aai/event/client/KafkaEventPublisher.java
+++ b/event-client-kafka/src/main/java/org/onap/aai/event/client/KafkaEventPublisher.java
@@ -42,6 +42,7 @@ public class KafkaEventPublisher implements EventPublisher {
private static Logger log = LoggerFactory.getInstance().getLogger(KafkaEventPublisher.class);
+ @FunctionalInterface
public interface KafkaProducerFactory {
public KafkaProducer<String, String> createProducer(Properties props);
}
@@ -54,15 +55,6 @@ public class KafkaEventPublisher implements EventPublisher {
private final String topic;
/**
- * Replace the producer factory (intended to be used for testing purposes only).
- *
- * @param producerFactory
- */
- static void setProducerFactory(KafkaProducerFactory producerFactory) {
- KafkaEventPublisher.producerFactory = producerFactory;
- }
-
- /**
*
* @param hosts - A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The
* client will make use of all servers irrespective of which servers are specified here for
@@ -109,6 +101,15 @@ public class KafkaEventPublisher implements EventPublisher {
}
/**
+ * Replace the producer factory (intended to be used for testing purposes only).
+ *
+ * @param producerFactory
+ */
+ static void setProducerFactory(KafkaProducerFactory producerFactory) {
+ KafkaEventPublisher.producerFactory = producerFactory;
+ }
+
+ /**
* Closes the publisher.
*/
@Override