Skip to main content
Raymond Camden
Community Manager
Community Manager
April 27, 2022
Question

Tip - using Custom Timeouts with the SDK

  • April 27, 2022
  • 0 replies
  • 316 views

Just a quick tip. Our docs explain how to use a custom timeout w/ the SDKs when calling services: https://developer.adobe.com/document-services/docs/overview/pdf-services-api/howtos/#custom-timeout-configuration. What we don't show is how to *use* that clientConfig object. It's really simple though - you pass it to your ExecutionContext creation call. Here's an example in Node, and it should be similar in your SDK of choice. 

 

const credentials = PDFServicesSdk.Credentials
		.serviceAccountCredentialsBuilder()
		.fromFile('pdftools-api-credentials.json')
		.build();

// set time outs to 2 minutes
const clientConfig = PDFServicesSdk.ClientConfig
		.clientConfigBuilder()
		.withConnectTimeout(1200000)
		.withReadTimeout(1200000)
		.build();

// Create an ExecutionContext using credentials
const executionContext = PDFServicesSdk.ExecutionContext.create(credentials, clientConfig);

 As an FYI, I've filed an issue internally to update our docs to mention this.

 

This topic has been closed for replies.