Batch processing
Batch processing refers to the execution of a series of tasks or operations in a grouped or batched manner, rather than individually or in real-time. This approach is commonly used in computing and data processing to efficiently handle large volumes of data or tasks that can be processed in parallel or in batches.
In batch processing, data or tasks are typically collected over a period of time or based on predefined criteria, and then processed together as a batch. This allows for optimizations such as reducing overhead, minimizing resource usage, and improving overall throughput.
Support for size-based batch processing
Size-based batch processing is a method of handling data or tasks in batches based on their size.
Adeptia introduces the following configuration within the Open API extensions to specify the batch Processing configuration supported by the API. This configuration defines how size-based batch processing is configured, including batch size limits, request structure, and handling of batch response results and faults.
Extension: Batch Processing
| Field name | Description | YAML |
|---|---|---|
| batchProcessing | Object containing batch processing settings. | <ch:codesample></ch:codesample> |
| SizeBased | Type of batch processing, in this case, size-based. Only SizeBased batch processing is supported. | <ch:codesample></ch:codesample> |
| batchSize | Object containing settings for batch size.
| <ch:codesample></ch:codesample> |
| requestTemplate | Reference to the schema defining the structure of batch requests.
| <ch:codesample></ch:codesample> |
| response | Object containing settings for batch response handling.
|
Example: Batch Processing definition for QuickBooks application
-
batchProcessing:- Top-level key indicating the batch processing configuration.
-
'SizeBased':-
Type of batch processing, in this case, size-based.
-
This section specifies settings specific to size-based batch processing.
-
-
batchSize:-
Object containing settings for batch size.
-
default:- Specifies the default batch size value. In this configuration, it's set to 25.
-
max:- Specifies the maximum batch size value. In this configuration, it's also set to 25.
-
-
requestTemplate:-
Defines the structure of the batch request.
-
$ref:-
References a schema definition for the batch request structure.
-
The
#symbol denotes the root of the document, and/components/schemas/BatchRequestspecifies the location of the schema definition within the OpenAPI document.
-
-
-
response:-
Object containing settings for batch response handling.
-
resultPath:-
Specifies the JSONPath expression to retrieve results from the batch response.
-
In this configuration,
$['results'][*]indicates that results are expected to be an array located under the 'results' key in the JSON response.
-
-
faultPath:-
Specifies the JSONPath expression to identify faults or errors in the batch response.
-
In this configuration,
$[?(@.statusCode>300 || @.statusCode<200)]specifies a condition to identify responses with status codes outside the 200-300 range as faults
-
-