Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Http Request Pooling!!  RSS feed

 
Ravi Shankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is there any possiblity we can hold the http request for a while or can we pool the http requests if multiple requests are coming at the same time.
Please help me in this regard.
Thanks in advance
Ravishankar
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure of pooling the rqust but u can control the number of threads processing the request in the server.xml file.
This will provide thread pooling and indirectly request pooling.
 
Ravi Shankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mr.Shan,
Thanks for your reply.
Actually my problem is, I've an JSP page with some query strings, i'l take that strings and i'l write it in the XML file, one thread is running behind and monitoring this XML file, as soon as a new value is founded in this file(that is the last one) this will take that value and will do some process. In case multiple requests are coming at a time, this thread will take the last value only, there is a chance of missing some value. Please help me in this regard, how to over come this problem. Thanks in advance Ravishankar
 
Parag Shah
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of writing the query strings to an xml file, you could use some sort of messaging service (JMS) in which messages are automatically pooled. So everytime the JSP is invoked it sends the query strings out as a message and some object will pick up the message to perform the processing. If you still wish to continue using xml files, you can generate a seperate file for each request and name the file with a unique name (timestamp + thread id). This way your messages will not be lost. Your processing object can process all xml files in a particular directory and delete the file after processing is over.
Hope it helps.
Parag
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ravishankar" and "pshah72",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
Ravi Shankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mr.Shan,
Thanks for the suggestion,
let me try it out,
Once again thanks for the solution
Regards
Ravi Shankar
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Alternatively, you can set your data as a session attribute with a HttpSessionBindingListener. After saving your data into your XML file, you unbind the attribute, alerting the listener, which it turn signals the other thread that is supposed to do some additional processing.
-anthony
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!