Created
November 22, 2020 22:18
-
-
Save razorcd/dc406040b2a15323bd4434b461806a1a to your computer and use it in GitHub Desktop.
Scaling reactive APIs - www.razorcodes.com
This file contains hidden or 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
@RestController | |
public class CustomerController { | |
private final RedisPuller redisPuller; | |
@GetMapping(value="/customer/{customerId}",produces = MediaType.TEXT_EVENT_STREAM_VALUE) | |
public Flux<CustomerUpdatedEvent> getCustomerData(@PathVariable String customerId) { | |
return redisPuller.getStreamEvents(customerId, Instant.now().toEpochMilli()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment