function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
phillpaffordphillpafford 

PHP - Bulk Outbound Messages causing java.net.SocketTimeoutException: Read timed out, fix?

So when SF sends my server an outbound message with 25 requests in 1 SOAP message everything works fine. But anything higher then that I get a "java.net.SocketTimeoutException: Read timed out" and my queue starts to back up. I understand that SF can sends up to 100 requests per SOAP message at a time but why does this not wotk for me?

 

I read the incoming SOAP request like this and then send back the ACK right away. Here is the code and the function.

 

[CODE]

$data = 'php://input';
$content = file_get_contents($data);

if($content) {
    respond('true');
} else {
    respond('false');
}

[/CODE]

 

The function

[CODE]

function respond($tf) {
    $ACK = <<<ACK
<?xml version = "1.0" encoding = "utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
            <Ack>$tf</Ack>
        </notifications>
    </soapenv:Body>
</soapenv:Envelope>
ACK;

    print trim($ACK);
}

[/CODE]

 

No this is in a the main processing file for this workflow and is call by the require_once() as I wanted to keep the recieving and ACK part generic so that I could add it to many projects.

 

I have also logged my response back to SF with this code and I only see the ACK response, so I know I'm sending the ACK back to SF.

 

Here is the code

[CODE]

// Place at the top of the script

ob_start();

 

// Place at end of the script

$get_response_sent = ob_get_contents();
ob_end_clean ();

echo $get_response_sent;

[/CODE]

 

I know my ACK gets to SF on the smaller queues but when the queue is over 100 out bound messages it fails.

 

Any thougts, suggestions?