Gitlab - Argos ALM by PALO IT
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
poc-measure-rest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Luis Eduardo Oviedo Granados
poc-measure-rest
Commits
51535dd8
Commit
51535dd8
authored
Jul 26, 2023
by
Alfredo Miranda Flores
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commet part of consumer kafka
parent
e2378717
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
src/main/java/com/cardif/pocmeasurerest/infra/config/MeasureConsumer.java
...m/cardif/pocmeasurerest/infra/config/MeasureConsumer.java
+1
-1
src/main/java/com/cardif/pocmeasurerest/infra/controller/MeasureController.java
...if/pocmeasurerest/infra/controller/MeasureController.java
+1
-1
src/main/java/com/cardif/pocmeasurerest/infra/repository/MeasureRepositoryImpl.java
...ocmeasurerest/infra/repository/MeasureRepositoryImpl.java
+1
-1
src/main/resources/application-local.properties
src/main/resources/application-local.properties
+11
-4
No files found.
src/main/java/com/cardif/pocmeasurerest/infra/config/MeasureConsumer.java
View file @
51535dd8
...
...
@@ -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
);
...
...
src/main/java/com/cardif/pocmeasurerest/infra/controller/MeasureController.java
View file @
51535dd8
...
...
@@ -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
;
...
...
src/main/java/com/cardif/pocmeasurerest/infra/repository/MeasureRepositoryImpl.java
View file @
51535dd8
...
...
@@ -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
());
}
...
...
src/main/resources/application-local.properties
View file @
51535dd8
...
...
@@ -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
...
...
@@ -23,3 +27,6 @@ management.info.os.enabled=true
# If it has security preferred when-authorized
management.endpoint.health.show-components
=
always
management.endpoint.health.show-details
=
always
#server configurations
server.port
=
9098
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment