updated pom of the cms-suite

This commit is contained in:
Francesco Mangiacrapa 2024-10-17 16:59:13 +02:00
parent aace2f9c3f
commit 4152d6f17f
5 changed files with 18 additions and 29 deletions

View File

@ -164,13 +164,7 @@
<dependency> <dependency>
<groupId>io.smallrye</groupId> <groupId>io.smallrye</groupId>
<artifactId>smallrye-health</artifactId> <artifactId>smallrye-health</artifactId>
<version>2.2.6</version> <version>2.1.0</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
</dependency> </dependency>
<!-- Plugins related tests --> <!-- Plugins related tests -->

View File

@ -7,8 +7,8 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.HealthCheckResponse;
import org.gcube.application.geoportal.service.health.GeoportalHealthCheck; import org.gcube.application.geoportal.service.rest.health.GeoportalHealthCheck;
import org.gcube.application.geoportal.service.health.MongoHealthCheck; import org.gcube.application.geoportal.service.rest.health.MongoHealthCheck;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

View File

@ -1,6 +1,4 @@
package org.gcube.application.geoportal.service.health; package org.gcube.application.geoportal.service.rest.health;
import javax.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.HealthCheckResponse;
@ -9,7 +7,7 @@ import org.eclipse.microprofile.health.Readiness;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@Readiness @Readiness
@Liveness @Liveness
@Slf4j @Slf4j
@ -20,7 +18,7 @@ public class GeoportalHealthCheck implements HealthCheck {
@Override @Override
public HealthCheckResponse call() { public HealthCheckResponse call() {
log.info(GeoportalHealthCheck.class.getSimpleName() + " call"); log.info(GeoportalHealthCheck.class.getSimpleName() + " call");
return HealthCheckResponse.named(SERVICE_NAME).state(true).withData("status", "healthy").build(); return HealthCheckResponse.named(SERVICE_NAME).status(true).withData("status", "healthy").build();
} }
} }

View File

@ -1,6 +1,4 @@
package org.gcube.application.geoportal.service.health; package org.gcube.application.geoportal.service.rest.health;
import javax.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.HealthCheckResponse;
@ -16,7 +14,6 @@ import com.mongodb.client.MongoIterable;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ApplicationScoped
@Readiness @Readiness
@Liveness @Liveness
@Slf4j @Slf4j
@ -41,7 +38,7 @@ public class MongoHealthCheck implements HealthCheck {
ScopeProvider.instance.set(context); ScopeProvider.instance.set(context);
mongo = ImplementationProvider.get().getProvidedObjectByClass(Mongo.class); mongo = ImplementationProvider.get().getProvidedObjectByClass(Mongo.class);
buildHCRBuilder = appendMongoInfo(buildHCRBuilder, mongo.getConnection()); buildHCRBuilder = appendMongoInfo(buildHCRBuilder, mongo.getConnection());
buildHCRBuilder.state(true); buildHCRBuilder.status(true);
MongoIterable<String> collections = mongo.getTheClient().getDatabase(mongo.getConnection().getDatabase()) MongoIterable<String> collections = mongo.getTheClient().getDatabase(mongo.getConnection().getDatabase())
.listCollectionNames(); .listCollectionNames();
log.info("listCollectionNames is null: {}", collections == null); log.info("listCollectionNames is null: {}", collections == null);
@ -53,7 +50,7 @@ public class MongoHealthCheck implements HealthCheck {
} }
return buildHCRBuilder.build(); return buildHCRBuilder.build();
} catch (Exception e) { } catch (Exception e) {
buildHCRBuilder.state(false); buildHCRBuilder.status(false);
if (mongo != null) { if (mongo != null) {
MongoConnection connection = null; MongoConnection connection = null;
try { try {

18
pom.xml
View File

@ -23,10 +23,10 @@
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl> <gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
<!-- default properties --> <!-- default properties -->
<gcube-smartgears-bom-version>2.5.1</gcube-smartgears-bom-version>
<storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range> <storagehub-version-range>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</storagehub-version-range>
<plugin-framework-version>1.0.6</plugin-framework-version> <gcube-smartgears-bom-version>${gcube-smartgears-bom-version-p}</gcube-smartgears-bom-version>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range> <plugin-framework-version>${plugin-framework-version-p}</plugin-framework-version>
<authorization-utils-range>${authorization-utils-range-p}</authorization-utils-range>
</properties> </properties>
<profiles> <profiles>
@ -39,9 +39,9 @@
</property> </property>
</activation> </activation>
<properties> <properties>
<gcube-smartgears-bom-version>2.5.1</gcube-smartgears-bom-version> <gcube-smartgears-bom-version-p>2.5.1</gcube-smartgears-bom-version-p>
<plugin-framework-version>1.0.6</plugin-framework-version> <plugin-framework-version-p>1.0.6</plugin-framework-version-p>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range> <authorization-utils-range-p>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range-p>
</properties> </properties>
</profile> </profile>
<!-- DEV profile --> <!-- DEV profile -->
@ -53,9 +53,9 @@
</property> </property>
</activation> </activation>
<properties> <properties>
<gcube-smartgears-bom-version>2.5.1-SNAPSHOT</gcube-smartgears-bom-version> <gcube-smartgears-bom-version-p>2.5.1-SNAPSHOT</gcube-smartgears-bom-version-p>
<plugin-framework-version>1.0.6-SNAPSHOT</plugin-framework-version> <plugin-framework-version-p>1.0.6-SNAPSHOT</plugin-framework-version-p>
<authorization-utils-range>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range> <authorization-utils-range-p>[2.0.0, 3.0.0-SNAPSHOT)</authorization-utils-range-p>
</properties> </properties>
</profile> </profile>
</profiles> </profiles>