Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

What's the correct scope of JiraRestClient?

Michal Hosala
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 20, 2021

We've been dealing with some OOM issues in our app which turned out to be JiraRestClient-related cause the instances were not getting closed. While trying to fix the issues one question arose - what's the expected lifespan/scope of a JiraRestClient instance?

We use it within our spring web application which concurrently serves many http requests and each of them fetches some jira data. Initially we went for JiraRestClient being singleton (spring default), but it turned out using `@RequestScope` yielded better results in terms of memory consumption and ability to serve more concurrent requests.

Unfortunately I haven't been able to find anywhere in your docs what would be the correct approach for our use case, i.e.:

* should the client be long lived (for the duration of the app)?

* or should it be per request?

0 answers

Suggest an answer

Log in or Sign up to answer