1
votes

My question is similar to this stackoverflow question.

I have a Spring application runs under tomcat on port 80. This is for RESTfull service and a web application.

Now new requirment comes in which is to use native Android clients (1000+) to exchange messages (events) from android app to the server, not android-to-android. I'm not going to use same tomcat server to use HTTP for this messaging pipeline because,

  1. Many android clients
  2. Many messages/events will be there
  3. Need a lighter protocol than HTTP

I though it is better to have a NIO socket server (ex: using websockets) such as Netty to handle only mobile client's messaging pipeline. However these mobile clients use RESTfull service as well.

Message/event flows for Android clients

Android ----> Netty ----> Spring App

All the other request/response

Android ----> Tomcat ----> Spring App
Web     ----> Tomcat ----> Spring App

They suppose to share the same authentication mechanism or separate mechanisms. However I have't though about that yet since no Netty is there.

I appreciate if anyone can give me directions, advice or sample configurations.

1

1 Answers

0
votes

You may embed Tomcat and Netty into spring application, making them to listen on different ports. Have a look at spring-boot project.

Tomcat supports websockets, may be you don't need the Netty. Netty supports http codec, maybe you don't need the tomcat:)