-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flattening the project structure - now demos are available directly a…
…t top level
- Loading branch information
Showing
44 changed files
with
67 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
# Compiled class file | ||
*.class | ||
.gradle | ||
build/ | ||
out/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
|
||
# Log file | ||
*.log | ||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
|
||
# BlueJ files | ||
*.ctxt | ||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
### NetBeans ### | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
.nb-gradle/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
hello-webflux/webflux-users/src/main/resources/application.properties
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
...rc/main/java/org/iproduct/demos/spring/reactivequotes/handlers/ReactiveQuotesHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.iproduct.demos.spring.reactivequotes.handlers; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.iproduct.demos.spring.reactivequotes.domain.Quote; | ||
import org.iproduct.demos.spring.reactivequotes.services.QuotesGenerator; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.reactive.function.server.ServerRequest; | ||
import org.springframework.web.reactive.function.server.ServerResponse; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.time.Duration; | ||
|
||
import static org.springframework.http.MediaType.APPLICATION_STREAM_JSON; | ||
import static org.springframework.http.MediaType.TEXT_EVENT_STREAM; | ||
|
||
@Component | ||
@Slf4j | ||
public class ReactiveQuotesHandler { | ||
|
||
@Autowired | ||
private QuotesGenerator generator; | ||
|
||
|
||
public Mono<ServerResponse> streamQuotes(ServerRequest request) { | ||
return ServerResponse.ok() | ||
.contentType(APPLICATION_STREAM_JSON) | ||
.body(generator.getQuoteStream(Duration.ofMillis(250)), Quote.class); | ||
} | ||
|
||
public Mono<ServerResponse> streamQuotesSSE(ServerRequest request) { | ||
return ServerResponse.ok() | ||
.contentType(TEXT_EVENT_STREAM) | ||
.body(generator.getQuoteStream(Duration.ofMillis(250)), Quote.class); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include 'reactive-quotes' | ||
include 'webflux-users' | ||
include 'quotes-demo-app' | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
server.port: 8080 | ||
endpoints.sensitive=false | ||
endpoints.metrics.enabled=true |
File renamed without changes.
File renamed without changes.
File renamed without changes.