Request Routing
All requests to White Server are sent on behalf of one of the aggregators. The list of aggregators can be found in the Aggregators section of the WS administrative panel.
There are two main request routing schemes:
- Direct requests to the cash register
- Requests via multi-agent.
If there are no multi-agents registered at the restaurant, the task goes to the agent in the restaurant.
Multi-agent
Multi-agent is connected automatically when activating integration with r_k Delivery.
If multi-agents are detected at a restaurant, the following parameters will be registered for each multi-agent:
- Priority — from 0 to 19999. The task is transferred to the multi-agent with the lowest priority value if it has the right to process this task.
- Skip requests from — a list of aggregators, requests from which the multi-agent skips and does not process. If the list is empty, the multi-agent processes requests from all aggregators.
Each multi-agent, when activated by an event, notifies the WS of the following parameters:
- Agent Activity — List of restaurants for which this multi-agent processes tasks
- Processes tasks — A list of task types that the multiagent processes.
Several multi-agents can be registered for one restaurant.
Task distribution rule:
- The multi-agent with the minimum priority is taken
- If the task can be processed by a multi-agent: the task type is supported, and the request is made from an aggregator that is not in the Skips requests from list, then the task is given to it
- Otherwise, the next multi-agent in priority is taken and checked.
- If there are no multi-agents that can handle the task, it is sent to the agent in the restaurant.
Direct requests for connected systems
Request routing is available for the following types of connected systems:
By default, requests are sent to the selected connected system.
But it is also possible, with the main connected system already selected, to send requests to another connected system by using the SystemName in the request. This is relevant for all connected systems except StoreHouse.
As an example, consider the CreateOrder request using systemName.
In this configuration, the default RKMid is set to the connected MID3 system, but the MID4 system is also available for sending requests.
To execute the request, you will need to add "systemName": "MID4" to the "params" section. This approach is also relevant for other connected systems such as RK Ref, SQL.
|
Description of general parameters of requests to WhiteServer | ||||
Parameter | Type | Mandatory | Description | Meaning |
async | - | Asynchronous method call (it is acceptable to use one of: synchronous or asynchronous) | ||
objectId | int | yes | Restaurant code in the licensing system | Присутствует во всех методах, кроме GetAgentList |
sync | - | Synchronous method call (it is acceptable to use one of: synchronous or asynchronous) | ||
systemName | string | no | Specifying the particular connected system for which the request is being made | Присутствует во всех методах, кроме GetAgentList |
timeout | int | - | Agent response time in seconds | default 120 seconds, |