Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Lists of 293 third-party dependencies.
Lists of 290 third-party dependencies.
(Apache License, Version 2.0) LZ4 Java Compression (at.yawk.lz4:lz4-java:1.10.3 - https://github.com/yawkat/lz4-java)
(EPL-2.0) (LGPL-2.1-only) Logback Classic Module (ch.qos.logback:logback-classic:1.5.37 - http://logback.qos.ch)
(EPL-2.0) (LGPL-2.1-only) Logback Core Module (ch.qos.logback:logback-core:1.5.37 - http://logback.qos.ch)
Expand Down Expand Up @@ -69,9 +69,6 @@ Lists of 293 third-party dependencies.
(The Apache Software License, Version 2.0) micrometer-tracing (io.micrometer:micrometer-tracing:1.6.6 - https://github.com/micrometer-metrics/tracing)
(The Apache Software License, Version 2.0) micrometer-tracing-bridge-otel (io.micrometer:micrometer-tracing-bridge-otel:1.6.6 - https://github.com/micrometer-metrics/tracing)
(The Apache License, Version 2.0) jnats (io.nats:jnats:2.23.0 - https://github.com/nats-io/nats.java)
(The Apache License, Version 2.0) jnats-json (io.nats:jnats-json:2.0.1 - https://github.com/nats-io/nats.java.json)
(The Apache License, Version 2.0) jwt-java (io.nats:jwt-java:2.2.0 - https://github.com/nats-io/jwt.java)
(The Apache License, Version 2.0) nkeys-java (io.nats:nkeys-java:2.1.1 - https://github.com/nats-io/nkeys.java)
(Apache License, Version 2.0) Netty/Buffer (io.netty:netty-buffer:4.2.15.Final - https://netty.io/)
(Apache License, Version 2.0) Netty/Codec (io.netty:netty-codec:4.2.15.Final - https://netty.io/)
(Apache License, Version 2.0) Netty/Codec/Base (io.netty:netty-codec-base:4.2.15.Final - https://netty.io/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ ICMS_CORE_DEPS = [
"@nv_third_party_deps//:io_micrometer_micrometer_registry_prometheus",
"@nv_third_party_deps//:io_micrometer_micrometer_tracing",
"@nv_third_party_deps//:io_nats_jnats",
"@nv_third_party_deps//:io_nats_jwt_java",
"@nv_third_party_deps//:io_netty_netty_transport",
"@nv_third_party_deps//:io_netty_netty_handler",
"@nv_third_party_deps//:io_opentelemetry_opentelemetry_exporter_otlp",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.nvidia.icms.configuration.bean;
package com.nvidia.icms.configuration.nats;

import java.time.Duration;
import java.util.Optional;
Expand All @@ -33,8 +33,8 @@ public class NatsConfigurationProperties {

private boolean natsEnabled;
private String natsUrl;
private int maxPoolSize = 8;
private boolean createNatsStreams;
private boolean createNatsConsumers;
private Duration connectionTimeout = Duration.ZERO;
private Duration pingInterval = Duration.ZERO;
private Duration reconnectWait = Duration.ZERO;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.nvidia.icms.configuration.nats;

import com.nvidia.icms.configuration.nats.NatsConfiguration.FixedNatsPool;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.health.autoconfigure.contributor.CompositeHealthContributorConfiguration;
import org.springframework.boot.health.contributor.AbstractHealthIndicator;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.contributor.HealthContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(prefix = "icms.nats", name = "nats-enabled", havingValue = "true")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

icms:
  nats:
    enabled: true|false

public class NatsHealthConfiguration extends
CompositeHealthContributorConfiguration<NatsHealthConfiguration.NatsHealthIndicator, FixedNatsPool> {

NatsHealthConfiguration() {
super(NatsHealthIndicator::new);
}

@RequiredArgsConstructor
public static class NatsHealthIndicator extends AbstractHealthIndicator {

private final FixedNatsPool connection;

@Override
protected void doHealthCheck(Health.Builder builder) {
if (connection.healthy()) {
builder.up();
} else {
builder.down();
}
}
}

@Bean
HealthContributor natsHealthContributor(Map<String, FixedNatsPool> connections) {
return createContributor(connections);
}
}

This file was deleted.

This file was deleted.

Loading
Loading