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
H
http-reactive-ms
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
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
Julian Pulido
http-reactive-ms
Commits
db20524c
Commit
db20524c
authored
Sep 07, 2023
by
Julian Pulido
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change name package and Structure project
parent
581f7da5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
57 deletions
+34
-57
src/main/java/com/example/http/reactive/HttpReactiveApplication.java
...va/com/example/http/reactive/HttpReactiveApplication.java
+0
-33
src/main/java/com/example/http/reactive/consumer/RuleConsumer.java
...java/com/example/http/reactive/consumer/RuleConsumer.java
+0
-22
src/main/java/com/example/http/reactive/handler/HttpHandlers.java
.../java/com/example/http/reactive/handler/HttpHandlers.java
+2
-2
src/main/java/com/example/http/reactive/handler/StreamHandlers.java
...ava/com/example/http/reactive/handler/StreamHandlers.java
+32
-0
No files found.
src/main/java/com/example/http/reactive/HttpReactiveApplication.java
View file @
db20524c
package
com.example.http.reactive
;
package
com.example.http.reactive
;
import
java.util.function.Consumer
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.Bean
;
import
com.example.http.reactive.dto.Message
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
reactor.core.publisher.Flux
;
import
reactor.core.publisher.Hooks
;
import
reactor.core.publisher.Hooks
;
@Slf4j
@Slf4j
...
@@ -18,36 +12,9 @@ import reactor.core.publisher.Hooks;
...
@@ -18,36 +12,9 @@ import reactor.core.publisher.Hooks;
@RequiredArgsConstructor
@RequiredArgsConstructor
public
class
HttpReactiveApplication
{
public
class
HttpReactiveApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
HttpReactiveApplication
.
class
,
args
);
SpringApplication
.
run
(
HttpReactiveApplication
.
class
,
args
);
Hooks
.
enableAutomaticContextPropagation
();
Hooks
.
enableAutomaticContextPropagation
();
}
}
/*@Bean
Consumer<Message<Rule>> ruleConsumer(){
return rule -> log.info("Consumer rule: {}", rule);
}
@Bean
Consumer<Message<com.example.http.reactive.dto.Message>> messageConsumer(){
return message -> log.info("Consumer message: {}", message);
}*/
/*@Bean
Consumer<Flux<Rule>> ruleConsumer() {
return ruleFlux -> ruleFlux.
doOnNext(rule -> log.info("Consumer rule: {}", rule))
.subscribe();
}*/
@Bean
Consumer
<
Flux
<
Message
>>
messageConsumer
()
{
return
messageFlux
->
messageFlux
.
doOnNext
(
message
->
log
.
info
(
"Consumer message: {}"
,
message
))
.
subscribe
();
}
}
}
src/main/java/com/example/http/reactive/consumer/RuleConsumer.java
deleted
100644 → 0
View file @
581f7da5
package
com.example.http.reactive.consumer
;
import
java.util.function.Consumer
;
import
org.springframework.stereotype.Component
;
import
com.example.http.reactive.dto.Rule
;
import
lombok.extern.slf4j.Slf4j
;
import
reactor.core.publisher.Flux
;
@Slf4j
@Component
public
class
RuleConsumer
implements
Consumer
<
Flux
<
Rule
>>
{
@Override
public
void
accept
(
Flux
<
Rule
>
ruleFlux
)
{
ruleFlux
.
doOnNext
(
rule
->
log
.
info
(
"Consumer rule: {}"
,
rule
))
.
subscribe
();
}
}
src/main/java/com/example/http/reactive/
controller/HttpReactiveController
.java
→
src/main/java/com/example/http/reactive/
handler/HttpHandlers
.java
View file @
db20524c
package
com.example.http.reactive.
control
ler
;
package
com.example.http.reactive.
hand
ler
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -16,7 +16,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -16,7 +16,7 @@ import lombok.extern.slf4j.Slf4j;
@RestController
@RestController
@RequestMapping
(
"/block"
)
@RequestMapping
(
"/block"
)
@RequiredArgsConstructor
@RequiredArgsConstructor
public
class
Http
ReactiveController
{
public
class
Http
Handlers
{
private
final
MessageProducerAdapter
messageProducerAdapter
;
private
final
MessageProducerAdapter
messageProducerAdapter
;
record
Response
(
Boolean
status
,
Object
payload
){}
record
Response
(
Boolean
status
,
Object
payload
){}
...
...
src/main/java/com/example/http/reactive/handler/StreamHandlers.java
0 → 100644
View file @
db20524c
package
com.example.http.reactive.handler
;
import
java.util.function.Consumer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
com.example.http.reactive.dto.Message
;
import
com.example.http.reactive.dto.Rule
;
import
lombok.extern.slf4j.Slf4j
;
import
reactor.core.publisher.Flux
;
@Slf4j
@Configuration
public
class
StreamHandlers
{
@Bean
Consumer
<
Flux
<
Rule
>>
ruleConsumer
()
{
return
ruleFlux
->
ruleFlux
.
doOnNext
(
rule
->
log
.
info
(
"Consumer rule: {}"
,
rule
))
.
subscribe
();
}
@Bean
Consumer
<
Flux
<
Message
>>
messageConsumer
()
{
return
messageFlux
->
messageFlux
.
doOnNext
(
message
->
log
.
info
(
"Consumer message: {}"
,
message
))
.
subscribe
();
}
}
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