Search code examples
ajaxgrailspush-notification

Grails 3 push notifications


I have got a grails app and a java app which sometimes sends messages to grails and calls some functions. It works fine, but my current task is to get error message from java and show it in my view without refreshing page. I've read that push events plugins could help me in this task, but I haven't find any plugin working with grails 3.3.0.

So, how can I solve this task? How bad is solution to send get ajax requests from client to server, and if server has any flag then send message in response?


Solution

  • For server to web client push you can use Server Send Events which is built into Grails or Spring Websockets which has a lot more functionality such as 2 way communication, topics, etc. Both work with Grails 3.3.x

    As you mentioned a polling ajax request may be simple enough to meet your needs.