fetch-event-source icon indicating copy to clipboard operation
fetch-event-source copied to clipboard

503 RECEIVED

Open datasmithadvtech opened this issue 3 years ago • 0 comments
trafficstars

Request Headers sent Accept: application/json, text/event-stream Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9.eyJhdWQiOiJhcGk6Ly82MjE3YzRjYy01Mjg2LTRjMTktYjUyMi01MTEyYTRhNTlmMWMiLCJp

@Slf4j @Validated @RestController @CrossOrigin(origins = "http://localhost:3000") @RequiredArgsConstructor

public class ResourceController {

@GetMapping(value = "/event/resources/usage", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Usage> getResourceUsage() {

    Random random = new Random();
    log.debug("getResourceUsage ");

    return Flux.interval(Duration.ofSeconds(1))
            .map(it -> new Usage(
                    random.nextInt(101),
                    random.nextInt(101),
                    new Date()));

}

}

datasmithadvtech avatar Oct 03 '22 19:10 datasmithadvtech