I need to write a application that can send push notifications at clients. But sometimes clients are disconnected, so I'd like to store notifications and send them to clients when they reconnect.
Is there a way to achieve this ? I need a way to know if client is present before sending, OR a way to know if a notification is well received. And my notifications are client specific.
I can't show off a lot of code, but I'd like to use something like this :
@Autowired
private SimpMessagingTemplate messagingTemplate;
public void sendPush(Long clientId) {
messagingTemplate.convertAndSendToUser(clientId, "/queue/reply", myMessage);
// -> how do I know if message is received ?
}
I use spring-websocket and stomp-endpoint.
Thank you !