8

ive implemented a spring sseEmitter to send a very basic message as follows:

 @RequestMapping(value = "/events/broadcast", method =RequestMethod.GET)
public SseEmitter broadcastMessage() throws IOException{
    SseEmitter sseEmitter = new SseEmitter();
    sseEmitter.send("Message 1");
    sseEmitter.complete();
    return sseEmitter;


}

Client side:

 var source = new EventSource("/events/broadcast");
    source.onmessage = function(event){
        var i = 0;
    }

However upon running, the method gets called however I receive the following error in my browser:

GET http://localhost:8080/events/broadcast net::ERR_INCOMPLETE_CHUNKED_ENCODING

I figure its to do with browser settings because the code is consistent across other examples.

Any experience with resolving this kind of error would be appreciated - thanks.

Issam El-atif
  • 2,366
  • 2
  • 17
  • 22
D. Hill
  • 93
  • 1
  • 10

0 Answers0