Server side push with java

后端 未结 3 2002
自闭症患者
自闭症患者 2021-01-07 14:41

is it any simpler way then cometd as long-polling framework for java? Because what I need - is client specifies some parameters and sends them to server. Server process them

3条回答
  •  猫巷女王i
    2021-01-07 15:19

    Well if you are too lazy for cometd or reverse AJAX you can deploy a web service endpoint to your client (preferably restful and not SOAP) and have your server send back messages to your web service (acting as a client).

    It is simple to implement this.

    In your clien't initial request to the server, along with the other parameter, you can also send the port (or URL) that your endpoint is listening for notification.

    Then you just have to define the notification events and implement the rest of the logic.

提交回复
热议问题