Jenkins Java Client, Jenkins REST API

Jenkins setup:

  1. Version: 2.504.2

Hello Everyone,

In our project we are implementing the following:

  1. Manage User and Assign Role:
    Rest API: /role-strategy/strategy/assignUserRole
    Average Time Taken: ~2-3seconds

  2. Manage Role:
    Rest API: /role-strategy/strategy/addRole
    Average Time Taken: ~2-3seconds

  3. Build Pipeline:
    Rest API: /buildWithParameters?delay=0sec& (with custom choice parameters)
    Average Time Taken: ~2-3seconds

  4. Fetch Estimated Time to complete a build:
    Rest API: buildNumber/api/json
    Average Time Taken: ~1-2seconds

  5. Manage Dynamic Cloud Agent:
    Rest API(s):
    a) manage/cloud/doCreate - FOR CREATION
    Average Time Taken: 2-3seconds

b) manage/cloud/targetName/configSubmit - FOR UPDATION
Average Time Taken: ~2-3seconds

c) manage/cloud/targetName/doDelete - FOR DELETION
Average Time Taken: ~2-3seconds

  1. Create Pipeline:
    Rest API: /createItem?name=jobName
    Average Time Taken: ~2-3seconds

We are using all these API in our springboot code with basic authentication that is username:token, but as we have started the load testing for our project we are getting Timeout Error from Jenkins end, but when we checked for Jenkins log we didn’t find any error logs.

To eliminate usage of the Rest APIs, we even researched for the jenkins java client jars:

io.github.cdancy
jenkins-rest

It supports the following services (based on our requirements):
a) Authentication (basic and API token via property or environment variable)
b) Queue API (cancel, list queue items, query queue item)
c) Jobs API (build, buildInfo, buildWithParameters, config, create, delete, description, disable, enable, jobInfo, lastBuildNumber, lastBuidTimestamp and progressiveText)

REQUIREMENTS MISSING:
a) Manage User to Jenkins and assigning role.
b) Manage role.
c) Manage Dynamic Cloud Agents

com.offbytwo.jenkins
jenkins-client
0.3.8

It also provides the same functionality as the above jar.

REQUIREMENTS MISSING:
a) Manage User to Jenkins and assigning role
b) Manage role
c) Manage Dynamic Cloud Agents

Is there any other recommended Jenkins API client which is more stable and reliable?

I would assume that the java clients under the hood also use the REST API. So if Jenkins is slow it will not change anything.
As you’re using role-strategy plugin, make sure you’re using the latest version 799.v5b_e7b_ecc231e

When you get timeouts in Jenkins have you investigated what could be the cause? Do you have proper garbage collection settings for the jvm, enough memory?