简体   繁体   中英

Java REST Web Service with internal threading mechanism

I have a data-push web service implemented in REST which pushes the data in database.

Now I want to create one more web service which will take input from a data-push web service and perform some business logic for any alerts. If any alert is present then it will call an alert service. In this case data-push web service should detach as soon as it posts the required data.

My doubt is if there are too many request on data-push web service - lets say for every second - then how will it handle threading mechanism and post on new web service?

If you are worried about the throughput of the service pushing data, you can queue the data push requests up and have a pool of worker threads process them as time and system resources permit.

The queuing mechanism could be any number of solutions depending on your scalability and throughput requirements:

  1. In-Memory
  2. JMS Messaging Middleware
  3. Relational Database
  4. Distributed Cache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM