2 Replies Latest reply on Jan 16, 2020 8:37 AM by mark.brooks.180

    Why can't the Wildfly server handle concurrent REST requests after a httpSession is established

    mark.brooks.180

      I've run into a conundrum I'm trying to understand. I've implemented a very simple example REST service that runs within a Wildfly server. I have a standalone, multi-threaded Java test program that uses an Apache http client library to access the service. The client program has two independent threads simultaneously accessing the REST service. When the test program is run without establishing a httpSession on the server the server processes the requests concurrently (as shown in the server log). If the threads are run after establishing a httpSession the requests are processed by the server in a sequential fashion (as shown in the second server log). Note that both threads share a single session.

      Is this by design? What am I missing here? Thanks in advance.

      Here are the fundamentals of my environment:

      • Wildfly Server Info: Wildfly-17.0.0.Final running on Windows 10 using standalone, high availability configuration specified in standalone-ha.xml
      • Client Info: Apache http client 4.5.5 (The managed version).

      Here are the server logs representing both cases:

       

      Server log when no http session is established. 
      Requests run concurrently when there is no session.

      13:39:13,384 INFO (default task-5) Getting widget 3 
      13:39:13,384 INFO (default task-6) Getting widget 4 
      13:39:13,384 INFO (default task-6) DELAYING widget 4 
      13:39:13,384 INFO (default task-5) Returning widget 3 
      13:39:13,404 INFO (default task-6) DELAY COMPLETE widget 4 
      13:39:13,404 INFO (default task-6) Returning widget 4 
      13:39:13,408 INFO (default task-6) Getting widget 3 
      13:39:13,408 INFO (default task-6) Returning widget 3 
      13:39:13,409 INFO (default task-5) Getting widget 4 
      13:39:13,409 INFO (default task-5) DELAYING widget 4 
      13:39:13,413 INFO (default task-6) Getting widget 3 
      13:39:13,413 INFO (default task-6) Returning widget 3 
      13:39:13,419 INFO (default task-6) Getting widget 3 
      13:39:13,419 INFO (default task-6) Returning widget 3 
      13:39:13,425 INFO (default task-6) Getting widget 3 
      13:39:13,425 INFO (default task-6) Returning widget 3 
      13:39:13,430 INFO (default task-6) Getting widget 3 
      13:39:13,430 INFO (default task-6) Returning widget 3 
      13:39:13,436 INFO (default task-5) DELAY COMPLETE widget 4 
      13:39:13,436 INFO (default task-5) Returning widget 4 
      13:39:13,436 INFO (default task-6) Getting widget 3 
      13:39:13,436 INFO (default task-6) Returning widget 3 
      13:39:13,441 INFO (default task-6) Getting widget 4 
      13:39:13,441 INFO (default task-5) Getting widget 3 
      13:39:13,442 INFO (default task-6) DELAYING widget 4 
      13:39:13,442 INFO (default task-5) Returning widget 3 
      13:39:13,447 INFO (default task-5) Getting widget 3 
      13:39:13,447 INFO (default task-5) Returning widget 3 
      ...

       

       

      Server log after having established a http session. 
      Requests run sequentially after having established a session.

      13:41:08,761 INFO (default task-5) Session established PA7xR3HCYMR3A2S6iX-4Ziw1dGVNejPktseYMMdm 
      13:41:08,808 INFO (default task-5) Getting widget 4 
      13:41:08,808 INFO (default task-5) DELAYING widget 4 
      13:41:08,829 INFO (default task-5) DELAY COMPLETE widget 4 
      13:41:08,829 INFO (default task-5) Returning widget 4 
      13:41:08,833 INFO (default task-6) Getting widget 3 
      13:41:08,833 INFO (default task-6) Returning widget 3 
      13:41:08,837 INFO (default task-5) Getting widget 4 
      13:41:08,837 INFO (default task-5) DELAYING widget 4 
      13:41:08,857 INFO (default task-5) DELAY COMPLETE widget 4 
      13:41:08,857 INFO (default task-5) Returning widget 4 
      13:41:08,860 INFO (default task-6) Getting widget 3 
      13:41:08,860 INFO (default task-6) Returning widget 3 
      13:41:08,863 INFO (default task-5) Getting widget 4 
      13:41:08,864 INFO (default task-5) DELAYING widget 4 
      13:41:08,884 INFO (default task-5) DELAY COMPLETE widget 4 
      13:41:08,884 INFO (default task-5) Returning widget 4 
      13:41:08,887 INFO (default task-6) Getting widget 3 
      13:41:08,887 INFO (default task-6) Returning widget 3 
      13:41:08,890 INFO (default task-5) Getting widget 4 
      13:41:08,890 INFO (default task-5) DELAYING widget 4 
      13:41:08,911 INFO (default task-5) DELAY COMPLETE widget 4 
      13:41:08,911 INFO (default task-5) Returning widget 4 
      13:41:08,914 INFO (default task-6) Getting widget 3 
      13:41:08,915 INFO (default task-6) Returning widget 3 
      ...