Closed Zaky7 closed 3 years ago
Hi
What you need to do is in the register method store the id somewhere.
@GetMapping("/register/{id}")
public SseEmitter register(@PathVariable("id") String id) {
// id is the client id. store it somewhere
}
Then in the publishing code you specify the client which should receive the event
SseEvent.builder()
.event("msg").data("payload")
.addClientIds("client1") // or multiple client .addClientIds("client1", "client2", "client3")
.build();
thanks I will give it a try
it works thanks @ralscha
hi, want to use unicast. How can I use this library for unicasting?. We can create a new method for publishing to a single client.