diff --git a/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitCheckOptions.java b/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitCheckOptions.java index ea5b08fb63..572b0de7ba 100644 --- a/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitCheckOptions.java +++ b/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitCheckOptions.java @@ -79,4 +79,14 @@ public interface PrometheusBasedResourceLimitCheckOptions { */ @WithDefault("1000") int connectTimeout(); + + /** + * Gets the TCP port of the server that this client is configured to connect to. + *

+ * The default value of this property is 9090. + * + * @return The port number. + */ + @WithDefault("9090") + int port(); } diff --git a/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitChecksConfig.java b/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitChecksConfig.java index d1fad86669..307ba72369 100644 --- a/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitChecksConfig.java +++ b/adapter-base/src/main/java/org/eclipse/hono/adapter/resourcelimits/PrometheusBasedResourceLimitChecksConfig.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2019 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -10,6 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ + package org.eclipse.hono.adapter.resourcelimits; import org.eclipse.hono.client.amqp.config.AuthenticatingClientConfigProperties; @@ -68,7 +69,7 @@ public PrometheusBasedResourceLimitChecksConfig() { */ public PrometheusBasedResourceLimitChecksConfig(final PrometheusBasedResourceLimitCheckOptions options) { super(options.clientOptions()); - setPort(9090); + setPort(options.port()); this.cacheMaxSize = options.cacheMaxSize(); this.cacheMinSize = options.cacheMinSize(); this.cacheTimeout = options.cacheTimeout();