How do I change the timeout of the rest api?

Emmanuel Potvin January 17, 2013

I'm using the JiraRestClient class to extract issues of my projects. I need all the 643 issues of my project to be returned. The thing is, the server answer too slowly. I got a timeout exception every time.

Is it possible to change the timeout to something like 5 minutes?

Emmanuel

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Emmanuel Potvin February 3, 2013

I splitted my query with many calls of 50 results max. Not very clean but very working.

Manu

Davide Cavestro September 26, 2013

Could you please give me a hint on where you have found the timeout variable has been hardcoded on jira rest java client?

2 votes
Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2015

SQL for JIRA may help to export large datasets from JIRA.

The JDBC driver allows you to connect remotely over the HTTP protocol (just like REST). Internally, the driver uses the Apache HttpClient wink Furthermore, you do not have to code as there are a lot of free reporting tools to connect via JDBC and export data locally.  It also supports JIRA JQL to filter issues. 

If you are JIRA administrator, it would be event better, as SQL for JIRA  supports to export to CVS on the server.

Sam Huawey November 27, 2015

You gave a wrong answer. Emmanuel asked how to increase timeout in http, he is not asking about SQL.

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2015

Sam, I agree it MIGHT seem a wrong answers and maybe it is, of course, but such appreciation would depends on the Emmanuel's needs. I would clarify that my answer is NOT about SQL!. Emmanuel wants to extract data from JIRA via REST, and therefore this means: extract JIRA data in JSON format over HTTP. Furthermore, it looks like it is having performance problems and needs to increase the REST timeout to get the data. What Emmanuel and many people do not know yet is that there is an alternative API to extract data from JIRA over HTTP and it is just SQL for JIRA. The differences are that it is more standard and powerful and it might resolve the Emmanuel's problem which is NOT increasing the REST timeout threshold... it is extracting data from JIRA over HTTP in a reasonable period of time. So, I'm not giving a WRONG answer, IMHO, I'm giving an alternative to the real problem. Sometimes a line is not the shorter path between two points, Einstein said.

Emmanuel Potvin November 27, 2015

If my memory is right (since I needed this 3 years ago for a client I'm not working with anymore), sql wasn't an option because I needed the "rank" field which is computed by Jira agile and not in the database. Apart that, it would have been a good answer since I didn't have to use the rest api absolutely. About the hard-coded timeout, I remember that it was in the rest api but not where exactly...

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2015

Furthermore, Emmanuel was unable to increase the timeout threshold because it was hardcoded and needed to split the the query in many calls of 50 issue max. For sure a lot of people prefer perform a single query remotely over HTTP rather than splinting REST queries and joining the results later , ¿no? Just it is possible with SQL for JIRA ;)

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2015

If you are agree that SQL might be an alternative, please remove your negative vote ;))

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2015

Emmanuel, SQL for JIRA does not access to the JIRA native database in any way. All the data are fetched via the JIRA Java API and the the Rank is a custom field (computed by JIRA) and therefore SQL for JIRA shows the right values ;)

Emmanuel Potvin November 27, 2015

As I said, I don't have to deal with this problem anymore, But just for curiosity and because I may be faced by it again I'll take a look at this feature. However, I'm not the one who gave a negative vote. I just gave a positive one and it seems to have balanced it. Thanks for the help. You're right about the annoying many calls that need to be merged... It would have been great to avoid that.

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2015

Sam, read please the first section ("How it works") of this page: http://www.kintosoft.com/jdbc ;)

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2013

Timeout is mostly at your client side, check as per the programming language you are using to increase the http client timeout.

Emmanuel Potvin January 24, 2013

The JiraRestClient IS the client side. But I checked in the code and the timeout variable is hardcoded and impossible to change. I just splitted my calls into many smaller calls... ugly, but working...

TAGS
AUG Leaders

Atlassian Community Events