EJB service processing method and device, equipment and medium
A business processing and business request technology, applied in the computer field, can solve problems such as increased network layer overhead, reduced request processing efficiency, and inability to automatically adjust the EJB list.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment approach 1
[0040] Distribute multiple business requests to EJB instances corresponding to EJB clients.
[0041] Wherein, multiple service requests are distributed based on a session round robin algorithm (Session Round Robin). The session polling algorithm will only distribute the pressure to one EJB instance for the request from one EJB client.
[0042]When the EJB client is initialized, the instances in the EJB cluster instance list are randomly sorted and then the first EJB instance in the list is selected, after which all business requests of the EJB client are sent to the EJB instance. Wherein, the service request includes: a Java Naming and Directory Interface (JNDI) request and an EJB request.
[0043] Such as Figure 4 As shown, the business requests of the EJB client 1 are distributed to the corresponding EJB instance 3, and the business requests of the EJB client 2 are distributed to the corresponding EJB instance 1. Wherein, when creating a new IC (Initial Context, initiali...
Embodiment approach 2
[0046] Select an EJB instance from the first set in a polling manner, and distribute the service request to the EJB instance selected by polling.
[0047] Among them, multiple service requests are distributed to EJB instances based on the Request Round Robin algorithm.
[0048] For example, if there are 4 EJB instances in total, the business requests of the first group are distributed to the first EJB instance, the business requests of the second group are distributed to the second EJB instance, and the business requests of the third group are distributed to the third EJB instance. EJB instance, the business request of the fourth group is distributed to the fourth EJB instance, the business request of the fifth group is distributed to the first EJB instance, and so on.
[0049] Such as Figure 5 As shown, the business requests of the EJB client are distributed to EJB instance 1, EJB instance 2, and EJB instance 3 in turn. It should be noted that EJB requests will be polled t...
Embodiment approach 3
[0053] According to the current weight of each EJB instance in the first set, distribute multiple service requests to the EJB instances in the first set respectively.
[0054] According to the weight of EJB instances in the cluster, EJB instances are allocated to process EJB requests and JNDI requests. EJB requests and JNDI requests may be assigned to different EJB instances each time an EJB instance is allocated.
[0055] For the weight algorithm, if there are N EJB instances in the cluster, there are M surviving or healthy EJB instances, the total weight of M EJB instances is TotalWeight, the total number of current concurrent requests is GlobalConcurrent, and the weight of the currently distributed EJB instances is Weight, then the maximum number of concurrently processed requests MaxDispatchCount of the current distribution instance satisfies:
[0056] MaxDispatchCount=GlobalConcurrent*Weight / TotalWeight
[0057] +((GlobalConcurrent*Weight)%TotalWeight==0?0:1).
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


