This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neo4j: | |
pool: | |
metricsEnabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Neo4jMetricsCdiExtension implements Extension { | |
private void addMetrics(@Observes @Priority(PLATFORM_AFTER + 101) @Initialized(ApplicationScoped.class) Object event) { | |
Instance<Driver> driver = CDI.current().select(Driver.class); | |
Neo4jMetricsSupport.builder() | |
.driver(driver.get()) | |
.build() | |
.initialize(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Readiness | |
@ApplicationScoped | |
public class Neo4jHealthCheck implements HealthCheck { | |
private static final String CYPHER = "RETURN 1 AS result"; | |
private static final SessionConfig DEFAULT_SESSION_CONFIG = SessionConfig.builder() | |
.withDefaultAccessMode(AccessMode.WRITE) | |
.build(); | |
private final Driver driver; | |
@Inject | |
//will be ignored outside of CDI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>io.helidon.integrations.neo4j</groupId> | |
<artifactId>helidon-integrations-neo4j-health</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Neo4j neo4j = Neo4j.create(config.get("neo4j")); | |
Neo4jHealthCheck healthCheck = Neo4jHealthCheck.create(neo4j.driver()); | |
Driver neo4jDriver = neo4j.driver(); | |
HealthSupport health = HealthSupport.builder() | |
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks | |
.addReadiness(healthCheck) | |
.build(); | |
return Routing.builder() | |
.register(health) // Health at "/health" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>io.helidon.integrations.neo4j</groupId> | |
<artifactId>helidon-integrations-neo4j</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>io.helidon.integrations.neo4j</groupId> | |
<artifactId>helidon-integrations-neo4j-metrics</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>io.helidon.integrations.neo4j</groupId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/greet") | |
@RequestScoped | |
open class GreetResource | |
/** | |
* Using constructor injection to get a configuration property. | |
* By default this gets the value from META-INF/microprofile-config | |
* | |
*/ @Inject constructor( | |
/** | |
* The greeting message provider. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.helidon.kotlin.examples.quickstart.se | |
import healthSupport | |
import io.helidon.common.LogConfig | |
import io.helidon.config.Config | |
import io.helidon.health.checks.HealthChecks | |
import io.helidon.media.jsonp.JsonpSupport | |
import io.helidon.metrics.MetricsSupport | |
import io.helidon.webserver.Routing | |
import io.helidon.webserver.WebServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.helidon.kotlin.examples.quickstart.se | |
import healthSupport | |
import io.helidon.common.LogConfig | |
import io.helidon.config.Config | |
import io.helidon.health.checks.HealthChecks | |
import io.helidon.media.jsonp.JsonpSupport | |
import io.helidon.metrics.MetricsSupport | |
import io.helidon.webserver.Routing | |
import io.helidon.webserver.WebServer |
OlderNewer