In your use case, a messaging protocol is required. We do not know the extent of your problem, but you already said that you want the server to exchange requests between clients, so I would go with the existing solution, and not using my own approach.
JMS is mentioned and certainly a viable Java based solution, the other is XMPP , which is a widely used real-time instant messaging protocol.
This is an open standard that supports both the server and the client in all major languages ββand platforms. This will allow you to have standalone apps, web apps, and mobile apps that can communicate with each other. The only potential access for your use case is that it is text based. Since you did not say what requests you want to transfer back and forth, I donβt know if this will fit your bill or not.
You can use Smack for client-side development in Java and any OS server you want.
Robin source share