RE: java.net.SocketTimeoutException: Read timed out - Java API Client Failure - Remarketing List Update

790 views
Skip to first unread message
Message has been deleted

DCM API (DoubleClick Campaign Mgr)

unread,
Apr 8, 2020, 1:17:09 PM4/8/20
to dan...@dynamo.video, google-doubleclick-...@googlegroups.com
Hi, I am using the following  maven dependency on the project,
 
v3.3-rev20200326-1.30.9
 
 
After I execute an update with the Java Client, I obtain the following error
java.net.SocketTimeoutException: Read timed out
This is the code that I use to do the API Call 
public static Long update (Long id , Long advertiserId, Long floodlightActivityId, String remaketingListName,  Long retentionDays, String customVariableName, String value ) throws IOException, InterruptedException {
  Dfareporting reporting = DfaReportingFactory.getReporting();
  RemarketingList remarketingList = new RemarketingList();
  remarketingList.setId(id);
  remarketingList.setActive(true);
  remarketingList.setAdvertiserId(advertiserId);
  remarketingList.setLifeSpan(retentionDays);
  remarketingList.setName(remaketingListName);
  ListPopulationTerm term = new ListPopulationTerm();
  term.setOperator("STRING_EQUALS");
  term.setType("CUSTOM_VARIABLE_TERM");
  term.setVariableName(customVariableName);
  term.setValue(value);
  ListPopulationClause clause = new ListPopulationClause();
  clause.setTerms(ImmutableList.of(term));
  ListPopulationRule rule = new ListPopulationRule();
  rule.setFloodlightActivityId(floodlightActivityId);
  rule.setListPopulationClauses(ImmutableList.of(clause));
  remarketingList.setListPopulationRule(rule);
  RemarketingList result = reporting.remarketingLists().update(USER_PROFILE_ID, remarketingList).execute();
  System.out.println(result.getId());
  return result.getId();
}
 
 Using the API Explorer to check if everything is fine I obtain the following reponse with status code 200
 
{
 "kind": "dfareporting#remarketingList",
 "id": "xxxxxxxxx",
 "accountId": "xxxxxxxx",
 "advertiserId": "xxxxxxx",
 "advertiserIdDimensionValue": {
  "kind": "dfareporting#dimensionValue",
  "etag": "\"-DXKPkNrYsuS4cIxVPlr9bXMGCY/bhjQqrZ5JAR6qNyB6sE_NNI\"",
  "dimensionName": "dfa:advertiserId",
  "value": "xxxxxxxxx"
 },
 "name": "",
 "description": "",
 "active": false,
 "listSize": "0",
 "lifeSpan": "24",
 "listPopulationRule": {
  "floodlightActivityId": "",
  "floodlightActivityName": "",
  "listPopulationClauses": [
   {
    "terms": [
     {
      "variableName": "U3",
      "variableFriendlyName": "parentCategoryId",
      "operator": "NUM_EQUALS",
      "value": "",
      "negation": false,
      "type": "CUSTOM_VARIABLE_TERM"
     }
    ]
   }
  ]
 },
 "listSource": "REMARKETING_LIST_SOURCE_DFA"
}
 
If I inspect the decompiled I observe that is a problem to read the response given by the server, so could be a problem that the response is too long? It exist a way to increase the time out time? 

 


ref:_00D1U1174p._5001UZWq7G:ref

DCM API (DoubleClick Campaign Mgr)

unread,
Apr 8, 2020, 1:23:52 PM4/8/20
to dan...@dynamo.video, google-doubleclick-...@googlegroups.com
Hi,

I have redacted your post online since the post contains sensitive information. For any future posts, please make sure not to post sensitive information on the forum.
I recommend increasing the wait time and see how it works. If you still see this issue, then please contact us using 'Reply privately to author' option with latest logs in JSON format and timestamp of the request. Please note that the logs should include the request that you actually sent to us and got the socket exception.

Helpful link: https://developers.google.com/api-client-library/java/google-api-java-client/errors

Thanks,
Lakshmi, DCM API Team


ref:_00D1U1174p._5001UZWq7G:ref
Message has been deleted

Daniel González

unread,
Apr 9, 2020, 4:55:58 AM4/9/20
to Google's DoubleClick Campaign Manager API Forum
Hi 
Hi I found the solution to increase the read time out connection which is similar to put in the Helpful link you need to do in the following way

HttpResponse result = reporting.remarketingLists().update(USER_PROFILE_ID, remarketingList).buildHttpRequest().setReadTimeout(60000*3).execute();
RemarketingList remarketingListResult = result.parseAs(RemarketingList.class);

1- First you need to buildHttpRequest, after that setReadTimeOut or setConnectionTimeOut ,(in the same way provided in the link), and finally do the execute function


2- To work with the class you can use the function .parseAs, in the HTTP Response, and pass as a parameter the class that you need.


Regards

DCM API (DoubleClick Campaign Mgr)

unread,
Apr 9, 2020, 3:04:03 PM4/9/20
to dan...@dynamo.video, google-doubleclick-...@googlegroups.com
Hi,

Glad that the issue is resolved for you. Please let me know if you have any further questions.


Thanks,
Lakshmi, DCM API Team


ref:_00D1U1174p._5001UZWq7G:ref

DCM API (DoubleClick Campaign Mgr)

unread,
Apr 10, 2020, 10:13:32 AM4/10/20
to piotr.f...@publicisgroupe.com, dan...@dynamo.video, google-doubleclick-...@googlegroups.com
Hi all,

I am checking with rest of the team regarding downtime of API. I will keep you posted.


Thanks,
Lakshmi, DCM API Team


ref:_00D1U1174p._5001UZWq7G:ref
Reply all
Reply to author
Forward
0 new messages