Databases Reference
In-Depth Information
2. Save and repack the
myWebService.war
application.
3. Redeploy the
myWebService.war
application.
How it works...
The custom work manager works the same way as the default work manager, but is limited to
handle only the
myWebService.war
application requests.
In this recipe, a capacity constraint was also added to the work manager. The capacity
constraint is the sum of the concurrent executing threads (limited by max threads constraint)
and the queued requests. Since the
myWebServiceWM
is configured with the capacity
constraint and max threads constraint with the same value of 20, the work manager won't
allow any requests to be queued in the instance.
This application exposes only stateless web services, so there is no need for session affinity.
The requests can be load balanced in a round-robin fashion. When one WebLogic Server
instance reaches 20 concurrent requests, the next request will fail over to the next WebLogic
instance of the cluster. In practice, when the instance is overloaded with the defined max
threads running, it returns the HTTP Code 503. The recognizes the 503 code and fails over
the request to the next instance, which is transparent to the caller.
The HTTP request failover is controlled by the WebLogic plug-in, so it's
mandatory to use the Apache/OHS with the plug-in when configuring
work managers.
The WebLogic plug-in is covered in
Chapter 2
,
High Availability with WebLogic Clusters
.
It is a common mistake to suppose that the WebLogic Plug-ins 1.1 failover
works only when the
IDEMPOTENT
parameter is
true
. In fact, the parameter
affects only the requests that were accepted by the WebLogic instance.
Even when setting the
IDEMPOTENT
to
false
, the failover still works if the
plug-in cannot connect to a WebLogic Instance (connect failover) or when it
receives an HTTP 503 (overload failover). It is also recommended to set the
IDEMPOTENT
to
false
since it can inadvertently duplicate requests.
There's more...
The custom work manager can be created through WLST.
Search WWH ::
Custom Search