BulkAddQueueItems fails with an error message Maximum length exceeded. Error code: 1000

Adding items to queue using BulkAddQueueItems fails with an error message Maximum length exceeded. Error code: 1000

Issue Description

When a Datatable with a large number of records is given as input to BulkAddQueueItems it fails with an error message: "Maximum length exceeded. Error code: 1000".

Root Cause

  1. There is a limit of 50 MB on the payload size imposed from the back end.
  2. There are other limitations, read more here: Queue items large data fields.

Resolution

  1. Instead of sending all data at once to BulkAddQueueItems, send data in small batches.
  2. Based on the business requirements, the 'All or Nothing' or 'Process Independently' property option of BulkAddQueueItems needs to be set.

Note: If a fiddler trace is captured, you will see an error code: