-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Update spring cloud sample for bug modification and api upgrade #20195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5f39de8
4761b25
6dba450
56472c1
3d04693
b1578c6
33d5e8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
| import reactor.core.publisher.EmitterProcessor; | ||
| import reactor.core.publisher.Sinks; | ||
|
|
||
| /** | ||
| * @author Warren Zhu | ||
|
|
@@ -26,13 +26,13 @@ public class EventProducerController { | |
| private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderApplication.class); | ||
|
|
||
| @Autowired | ||
| private EmitterProcessor<Message<String>> emitterProcessor; | ||
| private Sinks.Many<Message<String>> many; | ||
|
|
||
| @PostMapping("/messages") | ||
| public ResponseEntity<String> sendMessage(@RequestParam String message) { | ||
| LOGGER.info("Going to add message {} to emitter", message); | ||
| emitterProcessor.onNext(MessageBuilder.withPayload(message).build()); | ||
| return ResponseEntity.ok("Sent!"); | ||
| LOGGER.info("Going to add message {} to Sinks.Many.", message); | ||
| many.emitNext(MessageBuilder.withPayload(message).build(), Sinks.EmitFailureHandler.FAIL_FAST); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you explain more on this method?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can some code snippet in this post https://spring.io/blog/2020/07/10/first-milestone-of-reactor-2020-0-codename-europium |
||
| return ResponseEntity.ok(message); | ||
| } | ||
|
|
||
| @GetMapping("/") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ spring: | |
| checkpoint-storage-account: [checkpoint-storage-account] | ||
| checkpoint-container: [checkpoint-container] | ||
| stream: | ||
| function: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why move this here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hope this is clearer, I put it at the bottom level of spring.stream.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, even though it makes no difference to me. |
||
| definition: consume;supply | ||
| bindings: | ||
| consume-in-0: | ||
| destination: [eventhub-name] | ||
|
|
@@ -32,8 +34,6 @@ spring: | |
| default: | ||
| producer: | ||
| errorChannelEnabled: true | ||
| function: | ||
| definition: consume;supply; | ||
| poller: | ||
| initial-delay: 0 | ||
| fixed-delay: 1000 | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.