Refactored Kafka Application to simplify dependencies
1. Fixed a Bug in KafkaProducer. Without this fix the App will not send data in GPB format.
2. Added two new services - KafkaProducerService and KafkaConfigService.
3. Fixed a TODO in the register API to return Kafka server information.
4. Removed the use of LeadershipService and ClusterService, since we are not ready for clustering yet.
Change-Id: If20ef5238bb4629af0c6769129494eb44abf1d3c
diff --git a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/dto/DefaultEventSubscriber.java b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/dto/DefaultEventSubscriber.java
index bf1fbf8..04f4e0b 100644
--- a/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/dto/DefaultEventSubscriber.java
+++ b/apps/kafka-integration/api/src/main/java/org/onosproject/kafkaintegration/api/dto/DefaultEventSubscriber.java
@@ -84,6 +84,7 @@
.addValue(subscriberGroupId.toString())
.add("eventType", eventType).toString();
}
+
/**
* To create an instance of the builder.
*
@@ -92,6 +93,7 @@
public static Builder builder() {
return new Builder();
}
+
/**
* Builder class for Event subscriber.
*/
@@ -107,8 +109,7 @@
}
@Override
- public Builder setSubscriberGroupId(EventSubscriberGroupId
- subscriberGroupId) {
+ public Builder setSubscriberGroupId(EventSubscriberGroupId subscriberGroupId) {
this.subscriberGroupId = subscriberGroupId;
return this;
}
@@ -122,13 +123,11 @@
@Override
public EventSubscriber build() {
checkNotNull(appName, "App name cannot be null");
- checkNotNull(subscriberGroupId, "Subscriber group ID cannot " +
- "be " +
- "null");
+ checkNotNull(subscriberGroupId,
+ "Subscriber group ID cannot " + "be " + "null");
checkNotNull(eventType, "Event type cannot be null");
- return new DefaultEventSubscriber(appName,
- subscriberGroupId,
+ return new DefaultEventSubscriber(appName, subscriberGroupId,
eventType);
}
}