Gitlab - Argos ALM by PALO IT

commet part of consumer kafka

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