• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confirmation wanted: request buffering after Servlet before dispatched action

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I just want a confirmation/explaination on the buffering of requests. We are developing a system that we want to sequentially handle requests. Various customers make use of the Servlet, where the sequentiality only matters for one customer.
First we wrote a Servlet that was directly instantiated. All requests were handled by this Servlet in sequential order. No matter what customer the request belonged to.
Now we came up with the following idea and tested it:
The Servlet is a dispatching Servlet, that dispatches request handling for a specific customer. It contains a table of handlers (that are instantiated at initialization to ensure sequential processing per customer) for each customer. When a request comes in with a parameter for the customer identifier, the Servlet uses that key to pass the request on to the specific handler.
In other words:
- The Servlet is a dispatcher containing a table of handlers.
- Each handler belongs to a customer and is instantiated at Servlet initialization.
- The Servlet does not handle requests sequential.
- The specific handler handles requests sequential.
Requests for customer A does not have to wait for requests for customer B. Requests for customer A do wait for eachother.
A requesttimeschema could look something like this:
CUSTOMER | TIMESTAMP
-----------------------------------
A | 15
A | 15
B | 16
A | 17
B | 20
B | 21
A | 18
A | 19
B | 40
The timestamps are in chronological order for each customer.
We tested this and it worked, but can anyone of you explain or confirm this? In our first situation buffering of request took place before the Servlet itself, now it seems that the buffering takes place before a certain handler, without bothering the other handlers.
Thanks in advance!
Jeroen Oosterlaar
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic