Saurabh
Saurabh

Reputation: 1406

Best Practises for developing a TCP Communicator

We are developing a Vehicle Tracking System. In this system, we fix a GPS device into the vehicle which sends the location data to our server using TCP communication. There can be more than 1000's of devices sending data at any given time. Please suggest me the best practices I should follow to build the TCP communicator. We are using java as programming language and MySQL as database server.

I need your suggestions on best practices I should follow along with the reasons. e.g. I should follow Thread-per-connection model or Thread-on-event model of multi-threading? Why that model? How should I implement connection pooling? Shall I implement messaging queue?,etc..

Thanks, Saurabh

Upvotes: 0

Views: 481

Answers (2)

heldt
heldt

Reputation: 4276

I have built a similar system. I used Mule3 for the tcp server listener and then after reading the data I just forwarded the data using JMS to an ActiveMQ server.

I had around 10-20 listeners on each queue processing the data, putting it in my database, running rules over the data to determine if alarms need to be sent etc.

This resultet in a very stable an easy to work environment. Small modules with specific tasks.

Upvotes: 2

Suraj Chandran
Suraj Chandran

Reputation: 24801

  1. Use NIO and make full use of multi-threading. If possible use some exisitng libraries like MINA

Upvotes: 0

Related Questions