Gitlab - Argos ALM by PALO IT

Commit 5554c333 authored by Andres Isaac Garcia's avatar Andres Isaac Garcia

Only send message to Kafka

parent fad81d96
......@@ -9,7 +9,10 @@ import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
@Repository
@Slf4j
public class MeasureRepositoryImpl implements MeasureRepository {
private final JpaMeasureRepository jpaMeasureRepository;
......@@ -26,10 +29,11 @@ public class MeasureRepositoryImpl implements MeasureRepository {
entity.setDate(LocalDateTime.now());
entity.setDeviceId(measure.deviceId());
entity.setValue(measure.value());
MeasureEntity entitySaved = jpaMeasureRepository.save(entity);
streamBridge.send("measureProducer", entitySaved);
return new Measure(entitySaved.getDeviceId(), entitySaved.getValue(),
entitySaved.getDate());
//MeasureEntity entitySaved = jpaMeasureRepository.save(entity);
streamBridge.send("measureProducer", entity);
log.info("Publish Message Kafka: {}", entity);
return new Measure(entity.getDeviceId(), entity.getValue(),
entity.getDate());
}
@Override
......
......@@ -5,7 +5,10 @@ import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;
import lombok.ToString;
@Document(collection = "measure")
@ToString
public class MeasureEntity {
@Id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment