jenkinsci / jms-messaging-plugin

https://plugins.jenkins.io/jms-messaging
12 stars 37 forks source link

Reduce the number of retries in order to avoid unnecessary attempts for test concoction bottom #255

Open tomswallaRH opened 1 year ago

tomswallaRH commented 1 year ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins: 2.303.3 OS: Fedora: 37 jms-messaging:1.1.27

Reproduction steps

When the user uses the test connection button and the config is incorrect (wrong pwd, expired certificate, etc.) and the user is stuck on testing, never-ending loop until the connection reaches the maximum 5050 attempt(s)

Expected Results

Notify the user with an appropriate error message and after a few minutes

Actual Results

The Error

[ssl://activemq-broker01.queue.company.com:12345, 
ssl://activemq-broker02.queue.company.com:12345] after: 5050 attempt(s) with 
Cannot send, channel has already failed: tcp://10.0.0.22:12345, 
continuing to retry.

Because of the high number of retries it uses (5050), it takes a long time for the user to get a response JMS message plugin test concoction bottom if one of these values config is incorrect (wrong pwd, expired certificate, etc.)

Anything else?

This the part that we need to be fixed

JMS message plugin test concoction bottom for user name and password https://github.com/jenkinsci/jms-messaging-plugin/blob/master/plugin/src/main/java/com/redhat/jenkins/plugins/ci/authentication/activemq/UsernameAuthenticationMethod.java#L121

JMS message plugin test concoction bottom for certificate https://github.com/jenkinsci/jms-messaging-plugin/blob/master/plugin/src/main/java/com/redhat/jenkins/plugins/ci/authentication/activemq/SSLCertificateAuthenticationMethod.java#L158