Hi,

I'm struggling to work out how to set relevant timeouts when using JRJC v2.0.0.  Can anybody help?

Any moderately long-running JQL produces a java.net.SocketTimeoutException exception.

I never had any issues when using version 1....

 

 

1 answer

final JiraRestClientFactory jiraRestClientFactory = new AsynchronousJiraRestClientFactory();
    JiraRestClient jiraRestClient = null;
    try {
      final HttpClientOptions options = new HttpClientOptions();
      options.setConnectionTimeout(jiraConnectTimeout, TimeUnit.MILLISECONDS);
      options.setSocketTimeout(jiraSocketTimeout, TimeUnit.MILLISECONDS);
      options.setRequestPreparer(new Effect<Request>() {
        @Override
        public void apply(final Request request) {
          new BasicHttpAuthenticationHandler(jiraUsername, jiraPassword).configure(request);
        }
      });
      URI serverUri = new URI(jiraUri);
      final DefaultHttpClient defaultHttpClient = new DefaultHttpClient(new NoOpEventPublisher(),
          new RestClientApplicationProperties(serverUri), ThreadLocalContextManagers.noop(), options);
      jiraRestClient = jiraRestClientFactory.create(serverUri, defaultHttpClient);
    }
    catch (URISyntaxException e) {
      log.error("createJiraRestClient error creating client: " + e.getMessage(), e);
    }

Suggest an answer

Log in or Sign up to answer
Community showcase

Scrum Roles Explained: the Do's and the Don'ts

Hello Community,  Today we are going to talk about the three Scrum Roles. There is the Development Team, the Scrum Master and the Product Owner. In my opinion these three are all really impo...

126 views 2 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you