It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Maximum number of rest call to Confluence

David Osteso Oct 22, 2014

Hello.

I'm doing several actions (querys, creation of pages, etc) to Confluence via REST.

The firsts actions are executed without problems but when it comes to a certain number of calls the server don't return anything and the application received a timeout.

We have checked the connection settings of the Confluence server and  we've extended the maximum number of simultaneous connections and enabled the Remote API.

I've tested on Confluence on Apache and nginx servers with Posgres and SQL Server with the same result.

What's more interesting the error doesn't happen when I tested against my local Confluence.

Do you have any idea of what  the problem could be?

All help would be appreciated.

Thanks.

2 answers

0 votes
Rodrigo Adami Atlassian Team Oct 23, 2014

Hi David,

I'm not very familiar with Rest Api Calls. I believe each time you request a rest api command, a connection will be created to the tomcat server.

So if you have a small number of connections set to maxthreads in apache tomcat (server.xml connector), that should be a problem. I would say to test with a bigger size for the threads. If this was done already as you commented in the description, maybe you should test with the latest version of confluence. As far as I know, the limit in within the connector for the tomcat app.

Cheers,

Rodrigo

0 votes
David Osteso Oct 24, 2014

Thanks for your help Rodrigo but that didn't work. I've achieved to locate the operation that throws the Timeout. It's the third attempt to create a label using the REST method.

It's very odd but the second two times the creation is successful but the third the server doesn't retrieve any response. I've tested with different pages and label and the result is the same. I think it's a bug in the API REST.

Post the C# code here: 

List<LabelEntity> listLabels = new List<LabelEntity>();
listLabels.Add(pLabelEntity);

jsonSerializer.WriteObject(memoryStream, listLabels);
memoryStream.Position = 0;

string url = Connection.UrlConfluence + "/rest/api/content/" + pIdContent +"/label/";
url += "?os_authType=basic";

Connect(url, ref request, Definitions.RequestMethod.POST);
bytesJson = memoryStream.ToArray();

string respuesta = Encoding.UTF8.GetString(bytesJson, 0, bytesJson.Length);
request.ContentType = "application/json";
request.ContentLength = bytesJson.Length;

using (Stream dataStream = request.GetRequestStream())
{
dataStream.Write(bytesJson, 0, bytesJson.Length);
}
response = (HttpWebResponse)request.GetResponse();

Thanks.

 

 

 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

875 views 0 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you