0

I'm developing a web and mobile app using spring mvc and I'm having a problem understanding the different protocols and tools to make instant messaging (like facebook messaging in the website or whatsapp instant notifications). one functionality besides chatting in the project is for a user to send a request and waiting for the other user to respond with notifying them instantly).

However I'm lost cause some say to use GCM or FCM for the mobile and others say there other protocols like STOMP and AQMP and some others. I don't know what to see and use in my rest api so that it works for both browsers and mobiles while taking performance and other issues into consideration and how to consume these messages from client (I mean does the consumption method varies based on the chosen protocol?). should I use multiple protocols and tools based on the source of the request (i.e. if mobile and Android --> GCM or FCM, if browser STOMP for example, if iOS --> don't know what to use).

I know it looks like a general question but I really got lost specially that I don't know what are the right things to choose these days to start with.

M.R.M
  • 540
  • 1
  • 13
  • 30

1 Answers1

0

Messaging stack consists of multiple components. One of them is message transport - used to pas messages between the server and the client. FCM/GCM/APNS in this context is the transport protocol.

GCM is deprecated in favor of FCM. FCM is going to work for Android, the latest versions of iOS, and even some browsers. However if the user disables notifications for your app, the messaging will stop working. There is also some unpredictable latency with push notifications, particularly if you would like to send high-volume messages like typing notifications.

Message format is another component of the stack. For instance, STOMP is the message format protocol. It's defined for any serial transport, i.e. can be used over FCM or TCP or websocket.

Given the questions you ask it looks completely impractical for you to write your own messaging stack. Just pick something off the shelf, like one of the million XMPP servers or a more modern one like Tinode. Google it.

Gene S
  • 495
  • 5
  • 14