Gitlab - Argos ALM by PALO IT

commet part of consumer kafka

parent e2378717
...@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component; ...@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
import java.util.function.Consumer; import java.util.function.Consumer;
@Component("createMeasure") @Component("measureConsumer")
public class MeasureConsumer implements Consumer<Measure> { public class MeasureConsumer implements Consumer<Measure> {
private static final Logger log = LoggerFactory.getLogger(MeasureConsumer.class); private static final Logger log = LoggerFactory.getLogger(MeasureConsumer.class);
......
...@@ -9,7 +9,7 @@ import java.util.Optional; ...@@ -9,7 +9,7 @@ import java.util.Optional;
@RestController @RestController
@CrossOrigin("*") @CrossOrigin("*")
@RequestMapping(value = "/measure", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/measure")
public class MeasureController { public class MeasureController {
private final MeasureService measureService; private final MeasureService measureService;
......
...@@ -27,7 +27,7 @@ public class MeasureRepositoryImpl implements MeasureRepository { ...@@ -27,7 +27,7 @@ public class MeasureRepositoryImpl implements MeasureRepository {
entity.setDeviceId(measure.deviceId()); entity.setDeviceId(measure.deviceId());
entity.setValue(measure.value()); entity.setValue(measure.value());
MeasureEntity entitySaved = jpaMeasureRepository.save(entity); MeasureEntity entitySaved = jpaMeasureRepository.save(entity);
streamBridge.send("createMeasure", entitySaved); streamBridge.send("measureProducer", entitySaved);
return new Measure(entitySaved.getDeviceId(), entitySaved.getValue(), return new Measure(entitySaved.getDeviceId(), entitySaved.getValue(),
entitySaved.getDate()); entitySaved.getDate());
} }
......
...@@ -8,12 +8,16 @@ spring.data.mongodb.authentication-database=admin ...@@ -8,12 +8,16 @@ spring.data.mongodb.authentication-database=admin
#Kafka configurations stream #Kafka configurations stream
spring.cloud.stream.kafka.binder.brokers=localhost:9092 spring.cloud.stream.kafka.binder.brokers=localhost:9092
spring.cloud.function.definition=createMeasure spring.cloud.function.definition=measureConsumer
#Producer #Producer
spring.cloud.stream.bindings.createMeasure.destination=measure spring.cloud.stream.bindings.measureProducer.destination=measure
# Actuator #Consumer
#spring.cloud.stream.bindings.measureConsumer-in-0.destination=measure
#spring.cloud.stream.bindings.measureConsumer-in-0.group=measureGroup
#Actuator
management.endpoints.jmx.exposure.exclude=* management.endpoints.jmx.exposure.exclude=*
management.endpoints.web.exposure.include=health,info,metrics,prometheus management.endpoints.web.exposure.include=health,info,metrics,prometheus
management.info.git.enabled=true management.info.git.enabled=true
...@@ -23,3 +27,6 @@ management.info.os.enabled=true ...@@ -23,3 +27,6 @@ management.info.os.enabled=true
# If it has security preferred when-authorized # If it has security preferred when-authorized
management.endpoint.health.show-components=always management.endpoint.health.show-components=always
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
#server configurations
server.port=9098
\ No newline at end of file
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