Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prid health check cherry-pick #1360

Merged
merged 2 commits into from
Aug 19, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.kernel.pridgenerator.constant.EventType;
import io.mosip.kernel.pridgenerator.constant.HibernatePersistenceConstant;
import io.mosip.kernel.pridgenerator.constant.PRIDGeneratorConstant;
import io.mosip.kernel.pridgenerator.constant.PRIDHealthConstants;
Expand Down Expand Up @@ -156,7 +157,7 @@ public void dispSpaceHealthChecker(Future<Status> future) {
*/
public void verticleHealthHandler(Future<Status> future, Vertx vertx) {

vertx.eventBus().send(PRIDGeneratorConstant.PRID_GENERATOR_ADDRESS, PRIDHealthConstants.PING, response -> {
vertx.eventBus().send(EventType.CHECKPOOL, PRIDHealthConstants.PING, response -> {

if (response.succeeded()) {
final JsonObject result = resultBuilder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void start(Future<Void> future) {
.produces(PRIDGeneratorConstant.APPLICATION_JSON);
// mount all the routers to parent router
parentRouter.mountSubRouter(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH), metricRouter);
parentRouter.mountSubRouter(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH), healthCheckRouter);
parentRouter.get(environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH)+PRIDGeneratorConstant.HEALTH_ENDPOINT).handler(healthCheckHandler);
parentRouter.mountSubRouter(
environment.getProperty(PRIDGeneratorConstant.SERVER_SERVLET_PATH) + PRIDGeneratorConstant.PRID,
pridFetcherRouter.createRouter(vertx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.core.env.Environment;

import io.mosip.kernel.pridgenerator.constant.EventType;
import io.mosip.kernel.pridgenerator.constant.PRIDHealthConstants;
import io.mosip.kernel.pridgenerator.constant.PridLifecycleStatus;
import io.mosip.kernel.pridgenerator.service.PridService;
import io.vertx.core.AbstractVerticle;
Expand Down Expand Up @@ -64,6 +65,7 @@ public void start(Future<Void> startFuture) {
LOGGER.info("event type is send {} eventBus{}", handler.isSend(), eventBus);
LOGGER.info("locked generation");
}
handler.reply(PRIDHealthConstants.ACTIVE);
});

MessageConsumer<String> initPoolConsumer = eventBus.consumer(EventType.INITPOOL);
Expand Down