Configuring Error Recovery and Callback information for Salesforce
When a Streaming Provider triggers error events such as 403::Unkown Client or 401::Authentication invalid, the CloudStreams server engine invokes error handler service and error handler service identifies whether the error is recoverable or not.
If the error is recoverable, the action is taken by the CloudStreams server engine to restore the listener to the function. Later, the callback service is invoked by the CloudStreams server engine, by providing the status of error recovery.
If the error is not recoverable, CloudStreams engine invokes the callback service, by providing the status of error recovery.
The default callback service is currently configured to log the error and error recovery status.
To configure error callback for Salesforce
1. Go to Integration Server Administrator > Solutions > CloudStreams > Providers.
2. Select the Salesforce.com provider to list all the connectors.
3. Click on the connector for which you have already created a listener.
4. Go to the Listener page and then go to the Error Callback Configuration section and configure the callback service. You can edit the callback service based on your configuration. The below image shows the configuration for Salesforce.com.
Configure the call back service:
Fields | Description |
Enabled | Once you configure the listener, you can use this option's drop-down list to recover the error: true false Note: By default, this field is set to true. |
Error Handler Service Name | Specifies the name of the service which is configured with Salesforce Connector. |
Retry Count | Specifies the maximum number of times that the system should attempt for the recoverable error if the initial attempt fails. The default is 3. |
Callback Service Name | Specifies the name of the callback service in Salesforce Connector to perform logging. Note: You can also customize the callback service and provide it in this field. |
Run As User | Click to assign a user to a selected listener. By default, Run As User is set to Administrator. You can now configure the Run as User in the Integration Server Administrator to assign a user to a listener. |
Example of an error response object that Salesforce sends to its subscribed clients
If a connection is lost due to unexpected network disruption, Salesforce server times out the client and deletes the client state. The client attempts to reconnect but the connection is rejected with the 403::Unknown Client Error error response object because the client state does not exist anymore. The error response returned when the client attempts to reconnect after a timeout is as follows:
{
"error":"403::Unknown client",
"successful":false,
"advice":{"interval":0,"reconnect":"handshake"}
}
When the client receives the 403::Unknown Client Error with the "reconnect":"handshake" advice field, the client must perform a new handshake. If the handshake is successful, the client must re-subscribe to the channel in the handshake listener.