Skip to content

Instantly share code, notes, and snippets.

@razorcd
Created November 22, 2020 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razorcd/dc406040b2a15323bd4434b461806a1a to your computer and use it in GitHub Desktop.
Save razorcd/dc406040b2a15323bd4434b461806a1a to your computer and use it in GitHub Desktop.
Scaling reactive APIs - www.razorcodes.com
@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