Class CometdService


  • @Service
    public class CometdService
    extends Object
    This service is used to receive all Cometd messages and then publish the messages to the right clients. A Cometd service channel is used so the messages sent by clients on this channel are only sent to the server (so by this service) and not to all the subscribed clients. It is up to the server to forward the messages to the right clients.
    • Constructor Detail

      • CometdService

        public CometdService()
    • Method Detail

      • onMessageReceived

        @Listener("/service/chat")
        public void onMessageReceived​(org.cometd.bayeux.server.ServerSession remoteSession,
                                      org.cometd.bayeux.server.ServerMessage message)
        This method receives all the websocket messages sent to the channel COMETD_CHANNEL_NAME and process them accordingly to their type
        Parameters:
        remoteSession -
        message -