How would I create an asynchronous notification system using RESTful web services?

前端 未结 4 1861
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 03:59

I have a Java application which I make available via RESTful web services. I want to create a mechanism so clients can register for notifications of events. The rub is that th

4条回答
  •  清歌不尽
    2021-02-04 04:46

    We have this problem and need low-latency asynchronous updates to relatively few listeners. Our two alternative solutions have been:

    1. Polling: Hammer the list of resources you need with GET requests
    2. Streaming event updates: Provide a monitor resource. The server keeps the connection open. As events occur, the server transmits a stream of event descriptions using multipart content-type or chunked transfer-encoding.

提交回复
热议问题