Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueuesClient.reconnectIntervalSeconds is converted to milliseconds #2

Open
emcintyre-hpe opened this issue Nov 27, 2024 · 0 comments
Open

Comments

@emcintyre-hpe
Copy link

The QueuesClient.reconnectIntervalSeconds property should be in seconds. However, it is multiplied by 1000 in the constructor and treated like milliseconds.

From the KubeMQClient constructor:

    this.reconnectIntervalSeconds = reconnectIntervalSeconds <= 0 ? (1*1000):(reconnectIntervalSeconds * 1000);

Here is a simple demo:

  public static void main(String[] args) {
    try (QueuesClient client = QueuesClient.builder()
                                      .address("localhost")
                                      .clientId("some-client")
                                      .reconnectIntervalSeconds(10)
                                      .build()) {
      System.out.println(client.getReconnectIntervalSeconds());
      assert client.getReconnectIntervalSeconds() == 10;
    }

This program prints 10000, and ends with an AssertionError (if assertions are enabled). I would expect it to print 10 and complete successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant