Search code examples
.netwindowsxmpprpcopenfire

Query data from mobile-apps via XMPP Design Architecture


I've built a mobile app (that have a chat feature in it) that used a .NET Web Service acting as an API for all transaction to my DB.

I see that : the performance of HTTP Request isn't very responsive, so I tried to use Openfire XMPP to create a small chat app and the performance was pretty convincing.

The question is :

How can I query some data (something like RPC) from the mobile apps via XMPP? and What is the correct/ideal architecture for this?

I'm thinking about creating a windows service application that always connect to the XMPP server, acting as an API for transaction to the DB. So it's like the mobile app sent a chat/request to the serviceapi@server and the windows service reply it with JSON/XML.


Solution

  • Assuming that you are using xmpp and openfire, few things that will help you to construct your architecture:

    1. Your mobile app can directly communicate with xmpp to send and receive message. You do not need any webservices on your server side to send or receive messages.(You need to make sure the users are registered on openfire)
    2. If you need to retrieve old messages then you need to install Monitoring service plugin to enable message archiving.
    3. xmpp also provides the online presence of users, so you can use this to implement whatsapp like feature of showing online.

    P.S: If you can be more specific about your requirements regarding your architeccture, then I can add up few more points.