Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
id 'org.sonarqube' version '7.2.2.6593'
id 'org.springframework.boot' version '4.0.1' apply false
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'co.com.bancolombia.cleanArchitecture' version '4.0.4'
id 'co.com.bancolombia.cleanArchitecture' version '4.0.5'
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ management:
include: health,prometheus
app:
async:
createTopology: true
listenReplies: true
app:
createTopology: true
listenReplies: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected Mono<Health> doHealthCheck(Health.Builder builder) {
private Health.Builder reduceHealth(Health.Builder builder, RCHealth health) {
String domain = health.details().getOrDefault(DOMAIN, UNKNOWN).toString();
if (health.status().equals(RCHealth.Status.DOWN)) {
log.error("Broker of domain {} is down", domain);
log.error("Broker of domain {} is down {}", domain, health.details());
return builder.down().withDetail(domain, health.details());
}
return builder.withDetail(domain, health.details());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.reactivecommons.async.starter.config.health.RCHealth;
import org.reactivecommons.async.starter.config.health.RCHealthIndicator;
import reactor.core.publisher.Mono;

import java.net.SocketException;

import static org.reactivecommons.async.starter.config.health.ReactiveCommonsHealthIndicator.DOMAIN;
import static org.reactivecommons.async.starter.config.health.ReactiveCommonsHealthIndicator.VERSION;

Expand All @@ -21,7 +18,6 @@ public class RabbitReactiveHealthIndicator extends RCHealthIndicator {
public RabbitReactiveHealthIndicator(String domain, ConnectionFactory connectionFactory) {
this.domain = domain;
this.connectionFactory = connectionFactory.clone();
this.connectionFactory.useBlockingIo();
}

@Override
Expand All @@ -31,13 +27,12 @@ public Mono<RCHealth> doHealthCheck(RCHealth.RCHealthBuilder builder) {
.map(status -> builder.up().withDetail(VERSION, status).build());
}

@SneakyThrows
private String getRawVersion(ConnectionFactory factory) {
Connection connection = null;
try {
connection = factory.newConnection();
return connection.getServerProperties().get(VERSION).toString();
} catch (SocketException e) {
} catch (Exception e) {
log.warn("Identified error", e);
throw new RabbitMQHealthException(e);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void shouldBeDown() throws IOException, TimeoutException {
Mono<RCHealth> result = indicator.doHealthCheck(RCHealth.builder());
// Assert
StepVerifier.create(result)
.expectError(TimeoutException.class)
.expectError(RabbitMQHealthException.class)
.verify();
}

Expand Down