Arquisoft / InciManager_i2b

InciManager_i2b
MIT License
1 stars 2 forks source link

Add new topics to kafka #17

Closed alejgh closed 6 years ago

alejgh commented 6 years ago

Right now we are only sending the messages to kafka using the "incident" topic. We have to add new topics so the dashboard can process the data received more easily.

Mi idea is the following. In the service that sends the data to kafka (KafkaService) we must call another service (this must be implemented) that receives an incident and returns the topic that must be used in kafka. It would be something like this (inside the KafkaService class):

public void sendToKafka(Incident incident) {
    String message = this.toKafkaMessage(incident);
    LOG.info("sending message='{}' to topic='{}'", message, topic);
        List<String> topics = xxxxxxService.getTopicsOf(incident);
        foreach topic in topics:
          kafkaTemplate.send(topic, message);
}

These are the following topics we will use for now (more topics will be added later):

Please note that a incident can have many topics (e.g. geolocated and sensor).