Start a conversation

Availability Check Failing with Integration Error Due to Stopped Messaging Batch Engine

Symptom

The Availability Check function on Sales Orders fails with an "Integration Error" message. The error affects one or more integrations (e.g., DFP/ad server inventory checks). Availability Check Status shows "Not Completed" and Inventory Available shows no value.

Additionally, outgoing integration messages may be accumulating in a "Pending" state without being processed.

Cause

The CloudSense Messaging batch engine (csam package) is not running. This engine processes outgoing integration messages, including availability check requests. When the engine is stopped, messages queue up in a "Pending" state and are never sent to the integration endpoint, causing the availability check to fail.

Resolution

Step 1: Check for stuck outgoing messages

Run the following SOQL query to identify messages stuck in a pending state:

SELECT Id, CreatedDate, csam__URL_File__c, csam__URL_Host__c
FROM csam__Outgoing_Message__c
WHERE csam__Status__c = 'Pending'
ORDER BY CreatedDate

If this returns a large number of records (especially spanning multiple days), the batch engine is likely stopped.

Step 2: Verify the messaging batch engine status

Check whether the csam batch engine is running:

SELECT Id, CreatedDate, CreatedBy.Name, JobType, ApexClass.Name,
  Status, JobItemsProcessed, TotalJobItems, NumberOfErrors,
  CompletedDate, ExtendedStatus
FROM AsyncApexJob
WHERE ApexClass.NamespacePrefix = 'csam'
ORDER BY CreatedDate DESC

If this returns zero rows, the batch engine has been stopped and needs to be restarted.

Step 3: Restart the messaging batch engine

  1. Navigate to the Messaging Admin Console:
    https://<YOUR_ORG_DOMAIN>--csam.vf.force.com/apex/AdminConsole
  2. Log in with a user that has the appropriate permissions (e.g., Callback Admin or System Administrator)
  3. Click the "Start Queueable" button to restart the batch engine

Step 4: Verify the engine is processing messages

After restarting, re-run the AsyncApexJob query from Step 2. You should now see csam batch jobs running. Wait a few minutes for the pending messages to be processed.

Step 5: Retry the availability check

Navigate to the affected Sales Order and run the Availability Check again. Confirm that it completes successfully and the inventory values are now populated.

Additional Notes

  • The csam batch engine can stop if there is an unhandled exception during message processing, or if it was manually stopped by an administrator
  • Once restarted, the engine will process all pending outgoing messages in queue order, including any that accumulated while it was stopped
  • If the engine stops again shortly after restarting, check the most recent AsyncApexJob records for error details in the ExtendedStatus field -- this may indicate a problematic message causing repeated failures
  • Monitor the csam__Outgoing_Message__c records periodically to ensure messages are being processed (Status should transition from "Pending" to "Sent" or "Delivered")
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments