Angular 2 spring boot server side events

前端 未结 4 638
囚心锁ツ
囚心锁ツ 2020-12-05 03:44

Can somebody please provide me an example for spring boot server side events?

Basically I need to push server side events to browser. I\'m using angular 2 and sprin

4条回答
  •  借酒劲吻你
    2020-12-05 03:45

    Now with Spring Webflux is easier to accomplish that task, just using MediaTypes like:

        @GetMapping(value = "/queue/events", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
        public Flux streamEvents() {
            return managerService.streamEvents();
        }
    

    So you can create architectures like:

    You can check a working implementation in https://github.com/htenjo/vqueue also with an RSocket example.

提交回复
热议问题